﻿using GameFramework;
using GameFramework.Enum;
/*
 * 名称：TNormNpc
 * 创建人：John
 * 创建时间：2012-3-6 9:35:39
 * 描述: 为游戏交易NPC基本属性
 *********************************************
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;

namespace M2Server
{
    public class TNormNpc : TAnimalObject
    {
        /// <summary>
        /// 游戏NPC类型
        /// </summary>
        public TNpcType m_NpcType = TNpcType.n_Merchant;
        /// <summary>
        /// 用于标识此NPC是否有效，用于重新加载NPC列表(-1 为无效)
        /// </summary>
        public sbyte m_nFlag = 0;
        // 
        public IList<TScript> m_ScriptList = null;
        /// <summary>
        /// 脚本文件所在目录
        /// </summary>
        public string m_sFilePath = String.Empty;
        /// <summary>
        /// 此NPC是否是隐藏的，不显示在地图中
        /// </summary>
        public bool m_boIsHide = false;
        /// <summary>
        /// NPC类型为地图任务型的，加载脚本时的脚本文件名为 角色名-地图号.txt
        /// </summary>
        public bool m_boIsQuest = false;
        public string m_sPath = String.Empty;
        /// <summary>
        /// 是否变色
        /// </summary>
        public bool m_boNpcAutoChangeColor = false;
        /// <summary>
        /// 变色间隔
        /// </summary>
        public uint m_dwNpcAutoChangeColorTick = 0;
        /// <summary>
        /// 变色时间
        /// </summary>
        public uint m_dwNpcAutoChangeColorTime = 0;
        public int m_nNpcAutoChangeIdx = 0;
        public ushort m_boGotoCount = 0;
        public Dictionary<int, TServerProcess> FNpcCondition;
        public delegate void TServerProcess(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result);

        /// <summary>
        /// 初始化
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();
            this.m_Castle = M2Share.g_CastleManager.InCastleWarArea(this);
        }

        public TNormNpc()
            : base()
        {
            this.m_boSuperMan = true;
            this.m_btRaceServer = Grobal2.RC_NPC;
            this.m_nLight = 2;
            this.m_btAntiPoison = 99;
            m_ScriptList = new List<TScript>();
            this.m_boStickMode = true;
            m_sFilePath = "";
            m_boIsHide = false;
            m_boIsQuest = true;
            m_boNpcAutoChangeColor = false;
            m_dwNpcAutoChangeColorTick = HUtil32.GetTickCount();
            m_dwNpcAutoChangeColorTime = 0;
            m_nNpcAutoChangeIdx = 0;
            m_boGotoCount = 0;// 执行Goto的次数
            InitProcessMessageList();
        }

        ~TNormNpc()
        {
            ClearScript();
            Dispose(m_ScriptList);
        }

        internal void InitProcessMessageList()
        {
            FNpcCondition = new Dictionary<int, TServerProcess>();
            FNpcCondition[M2Share.nCHECK] = ConditionOfCheck;
            FNpcCondition[M2Share.nRANDOM] = ConditionOfRandom;
            FNpcCondition[M2Share.nGENDER] = ConditionOfGender;
            FNpcCondition[M2Share.nCHECKLEVEL] = ConditionOfCheckLevel;
            FNpcCondition[M2Share.nCHECKJOB] = ConditionOfCheckJob;
            //FNpcCondition[M2Share.nCHECKBBCOUNT] = ConditionOfBBCount;
            FNpcCondition[M2Share.nCHECKITEM] = ConditionOfCheckItem;
           // FNpcCondition[M2Share.nCHECKITEMW] = ConditionOfCheckItemW;
            FNpcCondition[M2Share.nCHECKGOLD] = ConditionOfCheckGold;
            FNpcCondition[M2Share.nCHECKDURA] = ConditionOfCheckDura;
            FNpcCondition[M2Share.nDAYOFWEEK] = ConditionOfDayOfWeek;
            FNpcCondition[M2Share.nHOUR] = ConditionOfHour;
            FNpcCondition[M2Share.nMIN] = ConditionOfMin;
            FNpcCondition[M2Share.nCHECKPKPOINT] = ConditionOfCheckPkPoint;
            FNpcCondition[M2Share.nCHECKMONMAP] = ConditionOfCheckMonMapCount;
            FNpcCondition[M2Share.nCHECKHUM] = ConditionOfCheckHum;
            FNpcCondition[M2Share.nCHECKBAGGAGE] = ConditionOfCheckBagGage;
            FNpcCondition[M2Share.nCHECKNAMELIST] = ConditionOfCheckNameList;
            FNpcCondition[M2Share.nCHECKACCOUNTLIST] = ConditionOfCheckAccountList;
            FNpcCondition[M2Share.nCHECKIPLIST] = ConditionOfCheckIPList;
            FNpcCondition[M2Share.nEQUAL] = ConditionOfEqual;
            FNpcCondition[M2Share.nLARGE] = ConditionOfLapge;
            FNpcCondition[M2Share.nSMALL] = ConditionOfSmall;
            FNpcCondition[M2Share.nSC_ISSYSOP] = ConditionOfISSYSOP;
            FNpcCondition[M2Share.nSC_ISADMIN] = ConditionOfISAdmin;
            FNpcCondition[M2Share.nSC_CHECKGROUPCOUNT] = ConditionOfCheckGroupCount;
            FNpcCondition[M2Share.nSC_CHECKPOSEDIR] = ConditionOfCheckPoseDir;
            FNpcCondition[M2Share.nSC_CHECKPOSELEVEL] = ConditionOfCheckPoseLevel;
            FNpcCondition[M2Share.nSC_CHECKPOSEGENDER] = ConditionOfCheckPoseGender;
            FNpcCondition[M2Share.nSC_CHECKLEVELEX] = ConditionOfCheckLevelEx;
            FNpcCondition[M2Share.nSC_CHECKBONUSPOINT] = ConditionOfCheckBonusPoint;
            FNpcCondition[M2Share.nSC_CHECKMARRY] = ConditionOfCheckMarry;
            FNpcCondition[M2Share.nSC_CHECKPOSEMARRY] = ConditionOfCheckPoseMarry;
            FNpcCondition[M2Share.nSC_CHECKMARRYCOUNT] = ConditionOfCheckMarryCount;
            FNpcCondition[M2Share.nSC_CHECKMASTER] = ConditionOfCheckMaster;
            FNpcCondition[M2Share.nSC_HAVEMASTER] = ConditionOfHaveMaster;
            FNpcCondition[M2Share.nSC_CHECKPOSEMASTER] = ConditionOfCheckPoseMaster;
            FNpcCondition[M2Share.nSC_POSEHAVEMASTER] = ConditionOfPoseHaveMaster;
            FNpcCondition[M2Share.nSC_CHECKISMASTER] = ConditionOfCheckIsMaster;
            FNpcCondition[M2Share.nSC_HASGUILD] = ConditionOfCheckHaveGuild;
            FNpcCondition[M2Share.nSC_ISGUILDMASTER] = ConditionOfCheckIsGuildMaster;
            FNpcCondition[M2Share.nSC_CHECKCASTLEMASTER] = ConditionOfCheckIsCastleMaster;
            FNpcCondition[M2Share.nSC_ISCASTLEGUILD] = ConditionOfCheckIsCastleaGuild;
            FNpcCondition[M2Share.nSC_ISATTACKGUILD] = ConditionOfCheckIsAttackGuild;
            FNpcCondition[M2Share.nSC_ISDEFENSEGUILD] = ConditionOfCheckIsDefenseGuild;
            FNpcCondition[M2Share.nSC_CHECKCASTLEDOOR] = ConditionOfCheckCastleDoorStatus;
            FNpcCondition[M2Share.nSC_ISDEFENSEALLYGUILD] = ConditionOfCheckIsDefenseAllyGuild;
            FNpcCondition[M2Share.nSC_CHECKPOSEISMASTER] = ConditionOfCheckPoseIsMaster;
            FNpcCondition[M2Share.nSC_CHECKNAMEIPLIST] = ConditionOfCheckNameIPList;
            FNpcCondition[M2Share.nSC_CHECKACCOUNTIPLIST] = ConditionOfCheckAccountIPList;
            FNpcCondition[M2Share.nSC_CHECKSLAVECOUNT] = ConditionOfCheckSlaveCount;
            FNpcCondition[M2Share.nSC_ISNEWHUMAN] = ConditionOfISNewHuman;
            FNpcCondition[M2Share.nSC_CHECKMEMBERTYPE] = ConditionOfCheckMemberType;
            FNpcCondition[M2Share.nSC_CHECKMEMBERLEVEL] = ConditionOfCheckMemBerLevel;
            FNpcCondition[M2Share.nSC_CHECKGAMEPOINT] = ConditionOfCheckGamePoint;
            FNpcCondition[M2Share.nSC_CHECKNAMELISTPOSITION] = ConditionOfCheckNameListPostion;
            FNpcCondition[M2Share.nSC_CHECKGUILDLIST] = ConditionOfCheckGuildList;
            FNpcCondition[M2Share.nSC_CHECKRENEWLEVEL] = ConditionOfCheckReNewLevel;
            FNpcCondition[M2Share.nSC_CHECKSLAVELEVEL] = ConditionOfCheckSlaveLevel;
            FNpcCondition[M2Share.nSC_CHECKSLAVENAME] = ConditionOfCheckSlaveName;
            FNpcCondition[M2Share.nSC_CHECKCREDITPOINT] = ConditionOfCheckCreditPoint;
            FNpcCondition[M2Share.nSC_CHECKOFGUILD] = ConditionOfCheckOfGuild;
            FNpcCondition[M2Share.nSC_CHECKUSEITEM] = ConditionOfCheckUseItem;
            FNpcCondition[M2Share.nSC_CHECKBAGSIZE] = ConditionOfCheckBagSize;
            FNpcCondition[M2Share.nSC_CHECKDC] = ConditionOfCheckDC;
            FNpcCondition[M2Share.nSC_CHECKMC] = ConditionOfCheckMC;
            FNpcCondition[M2Share.nSC_CHECKSC] = ConditionOfCheckSC;
            FNpcCondition[M2Share.nSC_CHECKHP] = ConditionOfCheckHP;
            FNpcCondition[M2Share.nSC_CHECKMP] = ConditionOfCheckMP;
            FNpcCondition[M2Share.nSC_CHECKITEMTYPE] = ConditionOfCheckItemType;
            FNpcCondition[M2Share.nSC_CHECKEXP] = ConditionOfCheckExp;
            FNpcCondition[M2Share.nSC_CHECKCASTLEGOLD] = ConditionOfCheckCastleGold;
            FNpcCondition[M2Share.nSC_CHECKBUILDPOINT] = ConditionOfCheckGuildBuildPoint;
            FNpcCondition[M2Share.nSC_CHECKAURAEPOINT] = ConditionOfCheckGuildAuraePoint;
            FNpcCondition[M2Share.nSC_CHECKSTABILITYPOINT] = ConditionOfCheckStabilityPoint;
            FNpcCondition[M2Share.nSC_CHECKFLOURISHPOINT] = ConditionOfCheckFlourishPoint;
            FNpcCondition[M2Share.nSC_CHECKCONTRIBUTION] = ConditionOfCheckContribution;
            FNpcCondition[M2Share.nSC_CHECKRANGEMONCOUNT] = ConditionOfCheckRangeMonCount;
            FNpcCondition[M2Share.nSC_CHECKITEMADDVALUE] = ConditionOfCheckItemAddValue;
            FNpcCondition[M2Share.nSC_CHECKINMAPRANGE] = ConditionOfCheckInMapRange;
            FNpcCondition[M2Share.nSC_CASTLECHANGEDAY] = ConditionOfCheckCastleChageDay;
            FNpcCondition[M2Share.nSC_CASTLEWARDAY] = ConditionOfCheckCastleWarDay;
            FNpcCondition[M2Share.nSC_ONLINELONGMIN] = ConditionOfCheckOnlineLongMin;
            FNpcCondition[M2Share.nSC_CHECKGUILDCHIEFITEMCOUNT] = ConditionOfCheckChiefItemCount;
            FNpcCondition[M2Share.nSC_CHECKNAMEDATELIST] = ConditionOfCheckNameDateList;
            FNpcCondition[M2Share.nSC_CHECKUSERDATE] = ConditionOfCheckNameDateList;
            FNpcCondition[M2Share.nSC_CHECKMAPHUMANCOUNT] = ConditionOfCheckMapHumanCount;
            FNpcCondition[M2Share.nSC_CHECKMAPMONCOUNT] = ConditionOfCheckMapMonCount;
            FNpcCondition[M2Share.nSC_CHECKVAR] = ConditionOfCheckVar;
            FNpcCondition[M2Share.nSC_CHECKSERVERNAME] = ConditionOfCheckServerName;
            FNpcCondition[M2Share.nCHECKMAPNAME] = ConditionOfCheckMapName;
            FNpcCondition[M2Share.nINSAFEZONE] = ConditionOfCheckSafeZone;
            FNpcCondition[M2Share.nCHECKSKILL] = ConditionOfCheckSkill;
            FNpcCondition[M2Share.nSC_CHECKCONTAINSTEXT] = ConditionOfAnsiContainsText;
            FNpcCondition[M2Share.nSC_COMPARETEXT] = ConditionOfCompareText;
            FNpcCondition[M2Share.nSC_CHECKTEXTLIST] = ConditionOfCheckTextList;
            FNpcCondition[M2Share.nSC_ISGROUPMASTER] = ConditionOfIsGroupMaster;
            FNpcCondition[M2Share.nSC_CHECKCONTAINSTEXTLIST] = ConditionOfCheCkContAinsTextList;
            FNpcCondition[M2Share.nSC_CHECKONLINE] = ConditionOfCheckOnLine;
            FNpcCondition[M2Share.nSC_ISDUPMODE] = ConditionOfIsDupMode;
            FNpcCondition[M2Share.nSC_CHECKGAMEDIAMOND] = ConditionOfCheckGameDiaMond;
            FNpcCondition[M2Share.nSC_CHECKGAMEGIRD] = ConditionOfCheckGameGird;
        }

        private void ConditionOfCheck(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            int n14 = HUtil32.Str_ToInt(QuestConditionInfo.sParam1, 0);
            int n18 = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, 0);
            int n10 = PlayObject.GetQuestFalgStatus(n14);
            Result = true;
            if (n10 == 0)
            {
                if (n18 != 0)
                {
                    Result = false;
                }
            }
            else
            {
                if (n18 == 0)
                {
                    Result = false;
                }
            }
        }

        private void ConditionOfRandom(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            if (HUtil32.Random(QuestConditionInfo.nParam1) != 0)
            {
                Result = false;
            }
        }
        
        /// <summary>
        /// 检查玩家性别
        /// </summary>
        /// <param name="PlayObject">玩家对象</param>
        /// <param name="QuestConditionInfo">脚本参数</param>
        /// <param name="Result">返回结果</param>
        private void ConditionOfGender(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if ((QuestConditionInfo.sParam2).ToLower().CompareTo(("HERO").ToLower()) == 0)// 增加检查英雄性别
            {
                if (PlayObject.m_MyHero != null)
                {
                    if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("MAN").ToLower()) == 0)
                    {
                        if (PlayObject.m_MyHero.m_btGender != 0)
                        {
                            Result = false;
                        }
                    }
                    else if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("WOMAN").ToLower()) == 0)
                    {
                        if (PlayObject.m_MyHero.m_btGender != 1)
                        {
                            Result = false;
                        }
                    }
                }
                else
                {
                    Result = false;
                }
            }
            else
            {
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("MAN").ToLower()) == 0)
                {
                    if (PlayObject.m_btGender != 0)
                    {
                        Result = false;
                    }
                }
                else
                {
                    if (PlayObject.m_btGender != 1)
                    {
                        Result = false;
                    }
                }
            }
        }

        /// <summary>
        /// 检查玩家等级
        /// </summary>
        /// <param name="PlayObject">玩家对象</param>
        /// <param name="QuestConditionInfo">脚本参数</param>
        /// <param name="Result">返回结果</param>
        private void ConditionOfCheckLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            if (PlayObject.m_Abil.Level < QuestConditionInfo.nParam1)
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家职业
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckJob(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "WARRIOR", 3))
            {
                if (PlayObject.m_btJob != 0)
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "WIZARD", 3))
            {
                if (PlayObject.m_btJob != 1)
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "TAOIST", 3))
            {
                if (PlayObject.m_btJob != 2)
                {
                    Result = false;
                }
            }
        }

        /// <summary>
        /// 检查游戏物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private unsafe void ConditionOfCheckItem(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            string s01 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
            int n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), 0);
            int n1C = 0; 
            int nMaxDura = 0;
            int nDura = 0;
            TUserItem* UserItem;
            if ((QuestConditionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
            {
                if (PlayObject.m_MyHero != null)
                {
                    UserItem = ((THeroObject)(PlayObject.m_MyHero)).QuestCheckItem(s01, ref n1C, ref nMaxDura, ref nDura);
                }
            }
            else
            {
                UserItem = PlayObject.QuestCheckItem(s01, ref n1C, ref nMaxDura, ref nDura);
            }
            if (n1C < n14)
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查游戏金币数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGold(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            string s01 = QuestConditionInfo.sParam1;
            int n14 = 0;
            if ((s01 != "") && (s01[0] == '<') && (s01[1] == '$'))
            {
                n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), 0);
            }
            else if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref n14))
            {
                n14 = QuestConditionInfo.nParam1;
            }
            if (PlayObject.m_nGold < n14)
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查物品持久
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private unsafe void ConditionOfCheckDura(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            int n1C = 0;
            int nMaxDura = 0;
            int nDura = 0;
            PlayObject.QuestCheckItem(QuestConditionInfo.sParam1, ref n1C, ref nMaxDura, ref nDura);
            if (Convert.ToInt32(HUtil32.Round(nDura / 1000)) < QuestConditionInfo.nParam2)
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查日期是否相等
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfDayOfWeek(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "SUN", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "1")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "MON", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "2")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "TUE", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "3")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "WED", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "4")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "THU", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "5")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "FRI", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "6")
                {
                    Result = false;
                }
            }
            if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "SAT", 3))
            {
                if (DateTime.Now.DayOfWeek.ToString() != "7")
                {
                    Result = false;
                }
            }
        }

        /// <summary>
        /// 检查小时是否相等
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfHour(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if ((QuestConditionInfo.nParam1 != 0) && (QuestConditionInfo.nParam2 == 0))
            {
                QuestConditionInfo.nParam2 = QuestConditionInfo.nParam1;
            }
            int Hour = DateTime.Now.Hour;
            int Min = DateTime.Now.Minute;
            int Sec = DateTime.Now.Second;
            int MSec = DateTime.Now.Millisecond;
            if ((Hour < QuestConditionInfo.nParam1) || (Hour > QuestConditionInfo.nParam2))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查分钟是否相等
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfMin(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if ((QuestConditionInfo.nParam1 != 0) && (QuestConditionInfo.nParam2 == 0))
            {
                QuestConditionInfo.nParam2 = QuestConditionInfo.nParam1;
            }
            int Hour = DateTime.Now.Hour;
            int Min = DateTime.Now.Minute;
            int Sec = DateTime.Now.Second;
            int MSec = DateTime.Now.Millisecond;
            if ((Min < QuestConditionInfo.nParam1) || (Min > QuestConditionInfo.nParam2))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查PK值是否大于指定参数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPkPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nPKPOINT;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nPKPOINT = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nPKPOINT < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nPKPOINT))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKPKPOINT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nPkPoint == nPKPOINT)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nPkPoint > nPKPOINT)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nPkPoint < nPKPOINT)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nPkPoint >= nPKPOINT)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKPKPOINT");
            }
        }

        /// <summary>
        /// 检查一个地图内的怪物数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMonMapCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sMapName;
            int nCount;
            int nMapRangeCount;
            TEnvirnoment Envir;
            List<TBaseObject> MonList;
            TBaseObject BaseObject;
            byte nCode = 0;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                sMapName = QuestConditionInfo.sParam1;
                nCode = 1;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCount < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount);
                }
                nCode = 2;
                Envir = M2Share.g_MapManager.FindMap(sMapName);
                if ((Envir == null) || (nCount < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKMONMAP);
                    return;
                }
                nCode = 3;
                MonList = new List<TBaseObject>();
                try
                {
                    nCode = 4;
                    nMapRangeCount = UserEngine.GetMapMonster(Envir, MonList);
                    nCode = 5;
                    for (int I = MonList.Count - 1; I >= 0; I--)
                    {
                        if (MonList.Count <= 0)
                        {
                            break;
                        }
                        nCode = 6;
                        BaseObject = MonList[I];
                        if (BaseObject != null)
                        {
                            nCode = 7;
                            if ((BaseObject.m_btRaceServer < Grobal2.RC_ANIMAL) || (BaseObject.m_btRaceServer == Grobal2.RC_ARCHERGUARD) ||
                                (BaseObject.m_Master != null) || (BaseObject.m_btRaceServer == Grobal2.RC_NPC) || (BaseObject.m_btRaceServer == Grobal2.RC_PEACENPC))
                            {
                                MonList.RemoveAt(I);
                            }
                        }
                    }
                    nCode = 8;
                    nMapRangeCount = MonList.Count;
                    if (nMapRangeCount >= nCount)
                    {
                        Result = true;
                    }
                }
                finally
                {
                    Dispose(MonList);
                    //MonList.Free;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMonMapCount Code:" + (nCode).ToString());
            }
        }

        /// <summary>
        /// 检查指定地图玩家数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckHum(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            int n14 = 0;
            if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref n14))
            {
                n14 = QuestConditionInfo.nParam2;
            }
            if (UserEngine.GetMapHuman(QuestConditionInfo.sParam1) < n14)
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家包裹是否负重
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private unsafe void ConditionOfCheckBagGage(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            TStdItem* StdItem;
            string s01 = string.Empty;
            if (PlayObject.IsEnoughBag())
            {
                if (QuestConditionInfo.sParam1 != "")
                {
                    Result = false;
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref s01))
                    {
                        s01 = QuestConditionInfo.sParam1;
                    }
                    StdItem = UserEngine.GetStdItem(s01);
                    if (StdItem != null)
                    {
                        if (PlayObject.IsAddWeightAvailable(StdItem->Weight))
                        {
                            Result = true;
                        }
                    }
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家姓名是否存在指定文本中
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckNameList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (!GotoLable_CheckStringList(PlayObject.m_sCharName, m_sPath + QuestConditionInfo.sParam1))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家帐号是否存在指定文本中
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckAccountList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (!GotoLable_CheckStringList(PlayObject.m_sUserID, m_sPath + QuestConditionInfo.sParam1))
            {
                Result = false;
            }
        }
        
        /// <summary>
        /// 检查玩家IP是否存在指定文本中
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIPList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (!GotoLable_CheckStringList(PlayObject.m_sIPaddr, m_sPath + QuestConditionInfo.sParam1))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查指定变量是否相等
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfEqual(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            string s01 = string.Empty;
            string s02 = string.Empty;
            int n14 = 0;
            int n18 = 0;
            if (GotoLable_CheckVarNameNo(QuestConditionInfo, PlayObject, ref n14, ref n18))
            {
                if (n14 != n18)
                {
                    Result = false;
                }
                else
                {
                    Result = true;
                }
            }
            else
            {
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref s01))
                {
                    s01 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                }
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref s02))
                {
                    s02 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                }
                if ((s01).ToLower().CompareTo((s02).ToLower()) == 0)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }
        }

        /// <summary>
        /// 检查指定变量是否大于指定参数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfLapge(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            int n14 = 0;
            int n18 = 0;
            if (GotoLable_CheckVarNameNo(QuestConditionInfo, PlayObject, ref n14, ref n18))
            {
                if (n14 <= n18)
                {
                    Result = false;
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查指定变量是否小于指定参数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfSmall(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            int n14 = 0;
            int n18 = 0;
            if (GotoLable_CheckVarNameNo(QuestConditionInfo, PlayObject, ref n14, ref n18))
            {
                if (n14 >= n18)
                {
                    Result = false;
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家权限是否大于4
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfISSYSOP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (!(PlayObject.m_btPermission >= 4))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家权限是否大于6
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfISAdmin(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (!(PlayObject.m_btPermission >= 6))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家组队成员数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGroupCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result) 
        {
            Result = true;
            char cMethod;
            int nCount;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (PlayObject.m_GroupOwner == null)
                {
                    return;
                }
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGROUPCOUNT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGroupCount");
            }
        }

        /// <summary>
        /// 功能：可以检查对面人物站的位置性别（要求面对面）
        /// 格式：CHECKPOSEDIR 控制符(1,2)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseDir(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.GetPoseCreate() == PlayObject) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    switch (QuestConditionInfo.nParam1)
                    {
                        case 1:// 要求相同性别
                            if (PoseHuman.m_btGender == PlayObject.m_btGender)
                            {
                                Result = true;
                            }
                            break;
                        case 2:// 要求不同性别
                            if (PoseHuman.m_btGender != PlayObject.m_btGender)
                            {
                                Result = true;
                            }
                            break;
                        default:// 无参数时不判别性别
                            Result = true;
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseDir");
            }
        }

        /// <summary>
        /// 取对面人物等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nLevel;
            TBaseObject PoseHuman;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKPOSELEVEL);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    switch (cMethod)
                    {
                        case '=':
                            if (PoseHuman.m_Abil.Level == nLevel)
                            {
                                Result = true;
                            }
                            break;
                        case '>':
                            if (PoseHuman.m_Abil.Level > nLevel)
                            {
                                Result = true;
                            }
                            break;
                        case '<':
                            if (PoseHuman.m_Abil.Level < nLevel)
                            {
                                Result = true;
                            }
                            break;
                        default:
                            if (PoseHuman.m_Abil.Level >= nLevel)
                            {
                                Result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseLevel");
            }
        }

        /// <summary>
        /// 取对面人物性别
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseGender(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            byte btSex;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                btSex = 0;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("MAN").ToLower()) == 0)
                {
                    btSex = 0;
                }
                else if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("男").ToLower()) == 0)
                {
                    btSex = 0;
                }
                else if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("WOMAN").ToLower()) == 0)
                {
                    btSex = 1;
                }
                else if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("女").ToLower()) == 0)
                {
                    btSex = 1;
                }
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    if (PoseHuman.m_btGender == btSex)
                    {
                        Result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseGender");
            }
        }

        /// <summary>
        /// 检查玩家等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckLevelEx(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nLevel;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKLEVELEX);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_Abil.Level == nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_Abil.Level > nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_Abil.Level < nLevel)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_Abil.Level >= nLevel)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckLevelEx");
            }
        }

        private void ConditionOfCheckBonusPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nTotlePoint;
            int nCount = 0;
            char cMethod;
            try
            {
                Result = false;
                nTotlePoint = PlayObject.m_BonusAbil.DC + PlayObject.m_BonusAbil.MC + PlayObject.m_BonusAbil.SC + PlayObject.m_BonusAbil.AC + PlayObject.m_BonusAbil.MAC
                    + PlayObject.m_BonusAbil.HP + PlayObject.m_BonusAbil.MP + PlayObject.m_BonusAbil.Hit + PlayObject.m_BonusAbil.Speed + PlayObject.m_BonusAbil.X2;
                nTotlePoint = nTotlePoint + PlayObject.m_nBonusPoint;
                cMethod = QuestConditionInfo.sParam1[0];
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount))
                {
                    nCount = QuestConditionInfo.nParam2;
                }
                switch (cMethod)
                {
                    case '=':
                        if (nTotlePoint == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nTotlePoint > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nTotlePoint < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nTotlePoint >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckBonusPoint");
            }
        }

        /// <summary>
        /// 检查是否有配偶
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMarry(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (PlayObject.m_sDearName != "")
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMarry");
            }
        }

        /// <summary>
        /// 检查对面人物是否有配偶
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseMarry(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    if (((TPlayObject)(PoseHuman)).m_sDearName != "")
                    {
                        Result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseMarry");
            }
        }

        /// <summary>
        /// 检查玩家离婚次数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMarryCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nCount;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount))// 增加变量支持
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMARRYCOUNT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_btMarryCount == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_btMarryCount > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_btMarryCount < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_btMarryCount >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMarryCount");
            }
        }

        /// <summary>
        /// 检查是否拜师
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if ((PlayObject.m_sMasterName != "") && (!PlayObject.m_boMaster))
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMaster");
            }
        }

        /// <summary>
        /// 检查是否有师傅
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfHaveMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (PlayObject.m_sMasterName != "")
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfHaveMaster");
            }
        }

        /// <summary>
        /// 检查对面玩家是否已经拜师
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    if ((((TPlayObject)(PoseHuman)).m_sMasterName != "") && !(((TPlayObject)(PoseHuman)).m_boMaster))
                    {
                        Result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseMaster");
            }
        }

        /// <summary>
        /// 检查玩家是不是别人的徒弟
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfPoseHaveMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    if ((((TPlayObject)(PoseHuman)).m_sMasterName != ""))
                    {
                        Result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfPoseHaveMaster");
            }
        }

        /// <summary>
        /// 检查玩家是不是已经是别人的师父
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (PlayObject.m_boMaster)
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsMaster");
            }
        }

        /// <summary>
        /// 检查玩家是否已经行会
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckHaveGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = PlayObject.m_MyGuild != null;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHaveGuild");
            }
        }

        /// <summary>
        /// 检查玩家是否是行会掌门人
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsGuildMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = PlayObject.IsGuildMaster();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsGuildMaster");
            }
        }

        /// <summary>
        /// 检查玩家是否是沙巴克城主
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsCastleMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (PlayObject.IsGuildMaster() && (M2Share.g_CastleManager.IsCastleMember(PlayObject) != null))
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsCastleMaster");
            }
        }

        /// <summary>
        /// 检查当前行会是否属于沙巴克
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsCastleaGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (M2Share.g_CastleManager.IsCastleMember(PlayObject) != null)
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsCastleaGuild");
            }
        }

        /// <summary>
        /// 检查当前行会是否是攻城行会
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsAttackGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (this.m_Castle == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ISATTACKGUILD);
                    return;
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Result = this.m_Castle.IsAttackGuild(PlayObject.m_MyGuild);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsAttackGuild");
            }
        }

        /// <summary>
        /// 检查当前行会是否为守城方行会
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsDefenseGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (this.m_Castle == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ISDEFENSEGUILD);
                    return;
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Result = this.m_Castle.IsDefenseGuild(PlayObject.m_MyGuild);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsDefenseGuild");
            }
        }

        /// <summary>
        /// 检查沙巴克城门状态
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckCastleDoorStatus(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nDay;
            int nDoorStatus;
            TCastleDoor CastleDoor;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nDay = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nDay < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nDay);// 增加变量支持
                }
                nDoorStatus = -1;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("损坏").ToLower()) == 0)
                {
                    nDoorStatus = 0;
                }
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("开启").ToLower()) == 0)
                {
                    nDoorStatus = 1;
                }
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("关闭").ToLower()) == 0)
                {
                    nDoorStatus = 2;
                }
                if ((nDay < 0) || (this.m_Castle == null) || (nDoorStatus < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKCASTLEDOOR);
                    return;
                }
                CastleDoor = (TCastleDoor)this.m_Castle.m_MainDoor.BaseObject;
                switch (nDoorStatus)
                {
                    case 0:
                        if (CastleDoor.m_boDeath)//城门损坏
                        {
                            Result = true;
                        }
                        break;
                    case 1:
                        if (CastleDoor.m_boOpened)//城门打开
                        {
                            Result = true;
                        }
                        break;
                    case 2:
                        if (!CastleDoor.m_boOpened)//城门关闭
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckCastleDoorStatus");
            }
        }

        /// <summary>
        /// 检查当前行会是否为守城方联盟行会
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckIsDefenseAllyGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (this.m_Castle == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ISDEFENSEALLYGUILD);
                    return;
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Result = this.m_Castle.IsDefenseAllyGuild(PlayObject.m_MyGuild);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsDefenseAllyGuild");
            }
        }

        /// <summary>
        /// 检查对面的人物是不是别人的师傅
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckPoseIsMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TBaseObject PoseHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                PoseHuman = PlayObject.GetPoseCreate();
                if ((PoseHuman != null) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    if ((((TPlayObject)(PoseHuman)).m_sMasterName != "") && (((TPlayObject)(PoseHuman)).m_boMaster))
                    {
                        Result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPoseIsMaster");
            }
        }

        /// <summary>
        /// 检查登录人物名与IP是否与文本匹配
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckNameIPList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TStringList LoadList = null;
            string sCharName;
            string sCharAccount;
            string sCharIPaddr;
            string sLine;
            string sName = string.Empty;
            string sIPaddr;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                try
                {
                    sCharName = PlayObject.m_sCharName;
                    sCharAccount = PlayObject.m_sUserID;
                    sCharIPaddr = PlayObject.m_sIPaddr;
                    LoadList = new TStringList();
                    if (File.Exists(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1))
                    {
                        LoadList.LoadFromFile(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1);
                        if (LoadList.Count > 0)
                        {
                            for (int I = 0; I < LoadList.Count; I++)
                            {
                                sLine = LoadList[I];
                                if (sLine[0] == ';')
                                {
                                    continue;
                                }
                                sIPaddr = HUtil32.GetValidStr3(sLine, ref sName, new string[] { " ", "/", "\09" });
                                sIPaddr = sIPaddr.Trim();
                                if ((sName == sCharName) && (sIPaddr == sCharIPaddr))
                                {
                                    Result = true;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKNAMEIPLIST);
                    }
                }
                finally
                {
                    Dispose(LoadList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckNameIPList");
            }
        }

        /// <summary>
        /// 检查登录帐号名与IP是否与文本匹配
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckAccountIPList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TStringList LoadList;
            string sCharName;
            string sCharAccount;
            string sCharIPaddr;
            string sLine;
            string sName = string.Empty;
            string sIPaddr;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                LoadList = new TStringList();
                try
                {
                    sCharName = PlayObject.m_sCharName;
                    sCharAccount = PlayObject.m_sUserID;
                    sCharIPaddr = PlayObject.m_sIPaddr;
                    if (File.Exists(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1))
                    {
                        LoadList.LoadFromFile(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1);
                        if (LoadList.Count > 0)
                        {
                            for (int I = 0; I < LoadList.Count; I++)
                            {
                                sLine = LoadList[I];
                                if (sLine[0] == ';')
                                {
                                    continue;
                                }
                                sIPaddr = HUtil32.GetValidStr3(sLine, ref sName, new string[] { " ", "/", "\09" });
                                sIPaddr = sIPaddr.Trim();
                                if ((sName == sCharAccount) && (sIPaddr == sCharIPaddr))
                                {
                                    Result = true;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKACCOUNTIPLIST);
                    }
                }
                finally
                {
                    Dispose(LoadList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckAccountIPList");
            }
        }

        /// <summary>
        /// 检查玩家所带宠物的数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckSlaveCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nCount;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSLAVECOUNT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_SlaveList.Count == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_SlaveList.Count > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_SlaveList.Count < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_SlaveList.Count >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSlaveCount");
            }
        }

        /// <summary>
        /// 检查玩家是否是新玩家
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfISNewHuman(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = PlayObject.m_boNewHuman;
        }

        /// <summary>
        /// 检查当前玩家会员类型
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMemberType(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nType;
            char cMethod;
            try
            {
                nType = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nType < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nType))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMEMBERTYPE);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nMemberType == nType)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nMemberType > nType)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nMemberType < nType)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nMemberType >= nType)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMemberType");
            }
        }

        /// <summary>
        /// 检查当前玩家会员等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckMemBerLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nLevel;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMEMBERLEVEL);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nMemberLevel == nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nMemberLevel > nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nMemberLevel < nLevel)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nMemberLevel >= nLevel)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMemBerLevel");
            }
        }

        /// <summary>
        /// 检查当前玩家游戏点（能量点）
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGamePoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nGamePoint;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nGamePoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGamePoint < 0)
                {
                    nGamePoint = QuestConditionInfo.nParam2;
                }
                if (nGamePoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGamePoint))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGAMEPOINT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nGamePoint == nGamePoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nGamePoint > nGamePoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nGamePoint < nGamePoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nGamePoint >= nGamePoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGamePoint");
            }
        }

        /// <summary>
        /// 检查人物名字在文件中的位置
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckNameListPostion(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            TStringList LoadList = null;
            string sCharName;
            int nNamePostion;
            int nPostion;
            string sLine;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nNamePostion = -1;
                try
                {
                    sCharName = PlayObject.m_sCharName;
                    LoadList = new TStringList();
                    if (File.Exists(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1))
                    {
                        LoadList.LoadFromFile(M2Share.g_Config.sEnvirDir + QuestConditionInfo.sParam1);
                        if (LoadList.Count > 0)
                        {
                            for (int I = 0; I < LoadList.Count; I++)
                            {
                                sLine = LoadList[I].Trim();
                                if ((sLine == "") || (sLine[0] == ';'))
                                {
                                    continue;
                                }
                                if (string.Compare(sLine, sCharName, true) == 0)
                                {
                                    nNamePostion = I + 1;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKNAMELISTPOSITION);
                    }
                }
                finally
                {

                    Dispose(LoadList);
                }
                cMethod = QuestConditionInfo.sParam2[1];
                nPostion = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                if (nPostion < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nPostion);
                }
                SetValValue(PlayObject, QuestConditionInfo.sParam4, nNamePostion);
                if (nPostion < 0)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKNAMELISTPOSITION);
                    return;
                }
                switch (cMethod)
                {
                    case '=':
                        if (nNamePostion == nPostion)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nNamePostion > nPostion)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nNamePostion < nPostion)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nNamePostion >= nPostion)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckNameListPostion");
            }
        }

        /// <summary>
        /// 检查行会是否在列表中
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGuildList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = true;
            if (PlayObject.m_MyGuild != null)
            {
                if (!GotoLable_CheckStringList(PlayObject.m_MyGuild.sGuildName, m_sPath + QuestConditionInfo.sParam1))
                {
                    Result = false;
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查人物的转生次数
        /// 格式:CHECKRENEWLEVEL 控制符( ><= ) 转生次数(1-255)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckReNewLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nLevel;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKRENEWLEVEL);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_btReLevel == nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_btReLevel > nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_btReLevel < nLevel)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_btReLevel >= nLevel)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckReNewLevel");
            }
        }

        /// <summary>
        /// 检查宝宝的等级
        /// 格式:CHECKSLAVELEVEL 控制符(><=) 等级(1-7)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckSlaveLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nLevel;
            char cMethod;
            TBaseObject BaseObject;
            int nSlaveLevel;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSLAVELEVEL);
                        return;
                    }
                }
                nSlaveLevel = -1;
                if (PlayObject.m_SlaveList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_SlaveList.Count; I++)
                    {
                        BaseObject = ((TBaseObject)(PlayObject.m_SlaveList[I]));
                        if (BaseObject.m_Abil.Level > nSlaveLevel)
                        {
                            nSlaveLevel = BaseObject.m_Abil.Level;
                        }
                    }
                }
                if (nSlaveLevel < 0)
                {
                    return;
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (nSlaveLevel == nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nSlaveLevel > nLevel)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nSlaveLevel < nLevel)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nSlaveLevel >= nLevel)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSlaveLevel");
            }
        }

        /// <summary>
        /// 检查宝宝的名字
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckSlaveName(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sSlaveName = string.Empty;
            TBaseObject BaseObject;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (QuestConditionInfo.sParam1 == "")
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSLAVENAME);
                    return;
                }
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sSlaveName))
                {
                    sSlaveName = QuestConditionInfo.sParam1;
                }
                if (PlayObject.m_SlaveList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_SlaveList.Count; I++)
                    {
                        BaseObject = PlayObject.m_SlaveList[I];
                        if ((sSlaveName).ToLower().CompareTo((BaseObject.m_sCharName).ToLower()) == 0)
                        {
                            Result = true;
                            break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSlaveName");
            }
        }

        /// <summary>
        /// 检查人物当前声望点
        /// 格式:CHECKCREDITPOINT 控制符(><=) 声望点数(0-255)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckCreditPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nCreditPoint;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCreditPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCreditPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCreditPoint))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKCREDITPOINT);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_btCreditPoint == nCreditPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_btCreditPoint > nCreditPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_btCreditPoint < nCreditPoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_btCreditPoint >= nCreditPoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckCreditPoint");
            }
        }

        /// <summary>
        /// 检查行会名称是否相同
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Resul"></param>
        private void ConditionOfCheckOfGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Resul)
        {
            Resul = false;
            string sGuildName = string.Empty;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Resul = false;
                if (QuestConditionInfo.sParam1 == "")
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKOFGUILD);
                    return;
                }
                if ((PlayObject.m_MyGuild != null))
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sGuildName))// 增加变量支持
                    {
                        sGuildName = QuestConditionInfo.sParam1;
                    }
                    if (PlayObject.m_MyGuild.sGuildName.ToLower().CompareTo(sGuildName.ToLower()) == 0)
                    {
                        Resul = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckOfGuild");
            }
        }

        /// <summary>
        /// 检查人物身上指定物品位置是否佩带指定物品名称（为空则检查人物身上指定位置是否佩带物品）
        /// 格式:CHECKUSEITEM 物品位置(0-13) 物品名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Resul"></param>
        private unsafe void ConditionOfCheckUseItem(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nWhere;
            string sItmeName;
            TStdItem* StdItem;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nWhere = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), -1);
                sItmeName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);// 物品名称
                if (nWhere < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref nWhere);
                }
                if ((nWhere < 0) || (nWhere > m_UseItems.GetUpperBound(0)))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKUSEITEM);
                    return;
                }
                if (sItmeName != "")
                {
                    StdItem = UserEngine.GetStdItem(PlayObject.m_UseItems[nWhere]->wIndex);
                    if ((StdItem != null))
                    {
                        if ((HUtil32.SBytePtrToString(StdItem->Name, 0, StdItem->NameLen)).ToLower().CompareTo((sItmeName).ToLower()) == 0)
                        {
                            Result = true;
                        }
                    }
                }
                else if (PlayObject.m_UseItems[nWhere]->wIndex > 0)
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckUseItem");
            }
        }

        /// <summary>
        /// 功能：检查人物背包空格数,Hero则判断英雄的背包
        /// 命令：CheckBagSize 数量 Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Resul"></param>
        private void ConditionOfCheckBagSize(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Resul)
        {
            Resul = false;
            int nSize = 0;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Resul = false;
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref nSize))
                {
                    nSize = QuestConditionInfo.nParam1;
                }
                if ((nSize <= 0) || (nSize > Grobal2.MAXHEROBAGITEM))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKBAGSIZE);
                    return;
                }
                if ((QuestConditionInfo.sParam2).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (PlayObject.m_MyHero.m_ItemList.Count + nSize <= Grobal2.MAXHEROBAGITEM)
                        {
                            Resul = true;
                        }
                    }
                }
                else
                {
                    if (PlayObject.m_ItemList.Count + nSize <= Grobal2.MAXBAGITEM)
                    {
                        Resul = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckBagSize");
            }
        }

        /// <summary>
        /// 检查人物攻击
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Resul"></param>
        private void ConditionOfCheckDC(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Resul)
        {
            Resul = false;
            char cMethodMin;
            char cMethodMax;
            int nMIN;
            int nMax;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Resul = false;
                cMethodMin = QuestConditionInfo.sParam1[0];
                cMethodMax = QuestConditionInfo.sParam1[2];
                nMIN = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                nMax = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);
                if ((nMIN < 0) || (nMax < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKDC);
                    return;
                }
                switch (cMethodMin)
                {
                    case '=':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.DC) == nMIN))
                        {
                            Resul = ConditionOfCheckDC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '>':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.DC) > nMIN))
                        {
                            Resul = ConditionOfCheckDC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '<':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.DC) < nMIN))
                        {
                            Resul = ConditionOfCheckDC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    default:

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.DC) >= nMIN))
                        {
                            Resul = ConditionOfCheckDC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                }
                Resul = false;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckDC");
            }
        }

        /// <summary>
        /// 检查人物魔法
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        /// <returns></returns>
        private void ConditionOfCheckMC(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethodMin;
            char cMethodMax;
            int nMIN;
            int nMax;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                cMethodMin = QuestConditionInfo.sParam1[0];
                cMethodMax = QuestConditionInfo.sParam1[2];
                nMIN = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                nMax = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);
                if ((nMIN < 0) || (nMax < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMC);
                    return;
                }
                switch (cMethodMin)
                {
                    case '=':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.MC) == nMIN))
                        {
                            Result = ConditionOfCheckMC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '>':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.MC) > nMIN))
                        {
                            Result = ConditionOfCheckMC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '<':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.MC) < nMIN))
                        {
                            Result = ConditionOfCheckMC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    default:

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.MC) >= nMIN))
                        {
                            Result = ConditionOfCheckMC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMC");
            }
        }

        /// <summary>
        /// 检查人物道术
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckSC(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethodMin;
            char cMethodMax;
            int nMIN;
            int nMax;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                cMethodMin = QuestConditionInfo.sParam1[0];
                cMethodMax = QuestConditionInfo.sParam1[2];
                nMIN = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                nMax = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);
                if ((nMIN < 0) || (nMax < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSC);
                    return;
                }
                switch (cMethodMin)
                {
                    case '=':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.SC) == nMIN))
                        {
                            Result = ConditionOfCheckSC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '>':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.SC) > nMIN))
                        {
                            Result = ConditionOfCheckSC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '<':

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.SC) < nMIN))
                        {
                            Result = ConditionOfCheckSC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    default:

                        if ((HUtil32.LoWord(PlayObject.m_WAbil.SC) >= nMIN))
                        {
                            Result = ConditionOfCheckSC_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSC");
            }
        }

        /// <summary>
        /// 检查人物血量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckHP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethodMin;
            char cMethodMax;
            int nMIN;
            int nMax;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                cMethodMin = QuestConditionInfo.sParam1[0];
                cMethodMax = QuestConditionInfo.sParam1[2];
                nMIN = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                nMax = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);
                if ((nMIN < 0) || (nMax < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHP);
                    return;
                }
                switch (cMethodMin)
                {
                    case '=':
                        if ((this.m_WAbil.HP == nMIN))
                        {
                            Result = ConditionOfCheckHP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '>':
                        if ((PlayObject.m_WAbil.HP > nMIN))
                        {
                            Result = ConditionOfCheckHP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '<':
                        if ((PlayObject.m_WAbil.HP < nMIN))
                        {
                            Result = ConditionOfCheckHP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    default:
                        if ((PlayObject.m_WAbil.HP >= nMIN))
                        {
                            Result = ConditionOfCheckHP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHP");
            }
        }

        /// <summary>
        /// 检查人物魔法量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        /// <returns></returns>
        private void ConditionOfCheckMP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethodMin;
            char cMethodMax;
            int nMIN;
            int nMax;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                cMethodMin = QuestConditionInfo.sParam1[0];
                cMethodMax = QuestConditionInfo.sParam1[2];
                nMIN = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                nMax = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);
                if ((nMIN < 0) || (nMax < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMP);
                    return;
                }
                switch (cMethodMin)
                {
                    case '=':
                        if ((this.m_WAbil.MP == nMIN))
                        {
                            Result = ConditionOfCheckMP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '>':
                        if ((PlayObject.m_WAbil.MP > nMIN))
                        {
                            Result = ConditionOfCheckMP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    case '<':
                        if ((PlayObject.m_WAbil.MP < nMIN))
                        {
                            Result = ConditionOfCheckMP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                    default:
                        if ((PlayObject.m_WAbil.MP >= nMIN))
                        {
                            Result = ConditionOfCheckMP_CheckHigh(PlayObject, cMethodMax, nMax);
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMP");
            }
        }

        /// <summary>
        /// 检查物品类型
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private unsafe void ConditionOfCheckItemType(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nWhere;
            int nType;
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nWhere = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), -1);
                nType = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nWhere < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref nWhere);// 增加变量支持
                }
                if (nType < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nType);// 增加变量支持
                }
                if (!(nWhere >= m_UseItems.GetLowerBound(0) && nWhere <= m_UseItems.GetUpperBound(0)))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKITEMTYPE);
                    return;
                }
                UserItem = PlayObject.m_UseItems[nWhere];
                if (UserItem->wIndex == 0)
                {
                    return;
                }
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((StdItem != null) && (StdItem->StdMode == nType))
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckItemType");
            }
        }

        /// <summary>
        /// 检查人物经验
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckExp(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            uint dwExp;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                dwExp = (uint)HUtil32.Str_ToInt(QuestConditionInfo.sParam2, 0);
                if (dwExp == 0)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKEXP);
                    return;
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_Abil.Exp == dwExp)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_Abil.Exp > dwExp)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_Abil.Exp < dwExp)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_Abil.Exp >= dwExp)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckExp");
            }
        }

        /// <summary>
        /// 检查沙巴克城堡金币数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        /// <returns></returns>
        private void ConditionOfCheckCastleGold(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nGold;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nGold = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGold < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGold);
                }
                if ((nGold < 0) || (this.m_Castle == null))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKCASTLEGOLD);
                    return;
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (this.m_Castle.m_nTotalGold == nGold)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (this.m_Castle.m_nTotalGold > nGold)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (this.m_Castle.m_nTotalGold < nGold)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (this.m_Castle.m_nTotalGold >= nGold)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckCastleGold");
            }
        }

        /// <summary>
        /// 检测行会行会人气
        /// 格式:CHECKGUILDAURAEPOINT 空字符（<>=） 数字
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGuildBuildPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nPoint;
            TGUild Guild;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nPoint))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKBUILDPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (Guild.nBuildPoint == nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (Guild.nBuildPoint > nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (Guild.nBuildPoint < nPoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (Guild.nBuildPoint >= nPoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGuildBuildPoint");
            }
        }

        /// <summary>
        /// 检测行会安定度
        /// 格式:CHECKGUILDSTABILITYPOINT 控制符（<>=）数字
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckGuildAuraePoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nPoint;
            TGUild Guild;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nPoint))// 增加变量支持
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKAURAEPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (Guild.nAurae == nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (Guild.nAurae > nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (Guild.nAurae < nPoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (Guild.nAurae >= nPoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGuildAuraePoint");
            }
        }

        /// <summary>
        /// 检测行会繁荣度
        /// 格式:CHECKGUILDSTABILITYPOINT 控制符（<>=）数字
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckStabilityPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nPoint;
            TGUild Guild;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nPoint))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSTABILITYPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (Guild.nStability == nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (Guild.nStability > nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (Guild.nStability < nPoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (Guild.nStability >= nPoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckStabilityPoint");
            }
        }

        /// <summary>
        /// 检查行会贡献度
        /// 格式:CHECKFLOURISHPOINT 控制符（<>=）数字
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckFlourishPoint(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nPoint;
            TGUild Guild;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nPoint))// 增加变量支持
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKFLOURISHPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (Guild.nFlourishing == nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (Guild.nFlourishing > nPoint)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (Guild.nFlourishing < nPoint)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (Guild.nFlourishing >= nPoint)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckFlourishPoint");
            }
        }

        /// <summary>
        /// 检查指定坐标范围内怪物数量
        /// 格式:CHECKCONTRIBUTION (Map)3 (x)333 (y)333
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        /// <returns></returns>
        private void ConditionOfCheckContribution(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nContribution;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nContribution = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nContribution < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nContribution))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKCONTRIBUTION);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_wContribution == nContribution)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_wContribution > nContribution)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_wContribution < nContribution)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_wContribution >= nContribution)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckContribution");
            }
        }

        /// <summary>
        /// 可以检查一个坐标范围内怪物数量
        /// 格式：CheckRangeMonCount 地图号 X坐标 Y坐标 范围 控制符(=,>,<) 数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckRangeMonCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sMapName;
            int nX;
            int nY;
            int nRange;
            int nCount;
            char cMethod = '0';
            int nMapRangeCount;
            TEnvirnoment Envir;
            IList<TPlayObject> MonList;
            TBaseObject BaseObject;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 地图支持变量
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam6), -1);
                if (QuestConditionInfo.sParam5 != "")
                {
                    cMethod = QuestConditionInfo.sParam5[0];
                }
                if (nX < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nX);
                }
                if (nY < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nY);
                }
                if (nRange < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam4, ref nRange);
                }
                if (nCount < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam6, ref nCount);
                }
                Envir = M2Share.g_MapManager.FindMap(sMapName);
                if ((Envir == null) || (nX < 0) || (nY < 0) || (nRange < 0) || (nCount < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKRANGEMONCOUNT);
                    return;
                }
                MonList = new List<TPlayObject>();
                try
                {
                    nMapRangeCount = Envir.GetRangeBaseObject(nX, nY, nRange, true, MonList);
                    for (int I = MonList.Count - 1; I >= 0; I--)
                    {
                        if (MonList.Count <= 0)
                        {
                            break;
                        }
                        BaseObject = ((TBaseObject)(MonList[I]));
                        if (BaseObject != null)
                        {
                            if ((BaseObject.m_btRaceServer < Grobal2.RC_ANIMAL) || (BaseObject.m_btRaceServer == Grobal2.RC_ARCHERGUARD)
                                || (BaseObject.m_Master != null) || (BaseObject.m_btRaceServer == Grobal2.RC_NPC)
                                || (BaseObject.m_btRaceServer == Grobal2.RC_PEACENPC))
                            {
                                MonList.RemoveAt(I);
                            }
                        }
                    }
                    nMapRangeCount = MonList.Count;
                    switch (cMethod)
                    {
                        case '=':
                            if (nMapRangeCount == nCount)
                            {
                                Result = true;
                            }
                            break;
                        case '>':
                            if (nMapRangeCount > nCount)
                            {
                                Result = true;
                            }
                            break;
                        case '<':
                            if (nMapRangeCount < nCount)
                            {
                                Result = true;
                            }
                            break;
                        default:
                            if (nMapRangeCount >= nCount)
                            {
                                Result = true;
                            }
                            break;
                    }
                }
                finally
                {
                    Dispose(MonList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckRangeMonCount");
            }
        }

        /// <summary>
        /// 检查人物身上物品的附加属性值
        /// 检查物品增加的附属属性
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe void ConditionOfCheckItemAddValue(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nWhere;
            int nAddAllValue;
            int nAddValue;
            TUserItem* UserItem;
            char cMethod;
            int nValType;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nWhere = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), -1);
                if (nWhere < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref nWhere);
                }
                nValType = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nValType < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nValType);
                }
                nAddValue = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);
                if (nAddValue < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam4, ref nAddValue);
                }
                cMethod = QuestConditionInfo.sParam3[1];
                if ((nValType < 0) || (nValType > 15) || (nWhere < 0) || (nWhere > m_UseItems.GetUpperBound(0)) || (nAddValue < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKITEMADDVALUE);
                    return;
                }
                UserItem = PlayObject.m_UseItems[nWhere];
                if (UserItem->wIndex == 0)
                {
                    return;
                }
                if (nValType == 15)// 15代表吸伤属性
                {
                    nValType = 20;
                }
                if (nValType == 14)
                {
                    nAddAllValue = UserItem->DuraMax;
                }
                else
                {
                    nAddAllValue = UserItem->btValue[nValType];
                }
                switch (cMethod)
                {
                    case '=':
                        if (nAddAllValue == nAddValue)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nAddAllValue > nAddValue)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nAddAllValue < nAddValue)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nAddAllValue >= nAddValue)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckItemAddValue");
            }
        }

        /// <summary>
        /// 功能:检测是否在同一地图范围内
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckInMapRange(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMapName;
            int nX;
            int nY;
            int nRange;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);
                if (nX < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nX);// 增加变量支持
                }
                if (nY < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nY);// 增加变量支持
                }
                if (nRange < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam4, ref nRange);// 增加变量支持
                }
                if ((sMapName == "") || (nX < 0) || (nY < 0) || (nRange < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKINMAPRANGE);
                    return result;
                }
                if ((PlayObject.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) != 0)
                {
                    return result;
                }
                if ((Math.Abs(PlayObject.m_nCurrX - nX) <= nRange) && (Math.Abs(PlayObject.m_nCurrY - nY) <= nRange))
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckInMapRange");
            }
            return result;
        }        
        
        /// <summary>
        /// 功能:检测是否在同一地图范围内
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckInMapRange(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sMapName;
            int nX;
            int nY;
            int nRange;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);
                if (nX < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nX);// 增加变量支持
                }
                if (nY < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nY);// 增加变量支持
                }
                if (nRange < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam4, ref nRange);// 增加变量支持
                }
                if ((sMapName == "") || (nX < 0) || (nY < 0) || (nRange < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKINMAPRANGE);
                    return;
                }
                if ((PlayObject.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) != 0)
                {
                    return;
                }
                if ((Math.Abs(PlayObject.m_nCurrX - nX) <= nRange) && (Math.Abs(PlayObject.m_nCurrY - nY) <= nRange))
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckInMapRange");
            }
        }

        /// <summary>
        /// 检查占领沙巴克天数
        /// 格式：CASTLECHANGEDAY 空字符（>） (天数)7 
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckCastleChageDay(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nDay;
            char cMethod;
            int nChangeDay;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nDay = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nDay < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nDay);// 增加变量支持
                }
                if ((nDay < 0) || (this.m_Castle == null))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CASTLECHANGEDAY);
                    return;
                }
                nChangeDay = HUtil32.GetDayCount(DateTime.Now, this.m_Castle.m_ChangeDate);
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (nChangeDay == nDay)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nChangeDay > nDay)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nChangeDay < nDay)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nChangeDay >= nDay)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckCastleChageDay");
            }
        }

        /// <summary>
        /// 检查上次攻城到现在的天数
        /// 格式:CASTLEWARAY   控制符(<=>)  天数 支持变量操作
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckCastleWarDay(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nDay;
            char cMethod;
            int nWarDay;
            try
            {
                Result = false;
                nDay = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nDay < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nDay);// 增加变量支持
                }
                if ((nDay < 0) || (this.m_Castle == null))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CASTLEWARDAY);
                    return;
                }
                nWarDay = HUtil32.GetDayCount(DateTime.Now, this.m_Castle.m_WarDate);
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (nWarDay == nDay)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nWarDay > nDay)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nWarDay < nDay)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nWarDay >= nDay)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckCastleWarDay");
            }
        }

        /// <summary>
        /// 检查当前人物登录游戏时间
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckOnlineLongMin(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nOnlineMin;
            int nOnlineTime;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nOnlineMin = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nOnlineMin < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nOnlineMin))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ONLINELONGMIN);
                        return;
                    }
                }
                nOnlineTime = Convert.ToInt32((HUtil32.GetTickCount() - PlayObject.m_dwLogonTick) / 60000);
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (nOnlineTime == nOnlineMin)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nOnlineTime > nOnlineMin)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nOnlineTime < nOnlineMin)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nOnlineTime >= nOnlineMin)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckOnlineLongMin");
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckChiefItemCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nCount;
            TGUild Guild;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCount = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nCount < 0)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKFLOURISHPOINT);
                    return;
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (Guild.nChiefItemCount == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (Guild.nChiefItemCount > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (Guild.nChiefItemCount < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (Guild.nChiefItemCount >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckChiefItemCount");
            }
        }

        /// <summary>
        /// 检查加入名单中人物的时间
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckNameDateList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            bool result = false;
            int I;
            TStringList LoadList;
            string sListFileName;
            string sLineText;
            string sHumName = string.Empty;
            string sDate = string.Empty;
            bool boDeleteExprie;
            bool boNoCompareHumanName;
            DateTime dOldDate;
            char cMethod;
            int nValNo;
            int nValNoDay;
            int nDayCount;
            int nDay;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                result = false;
                nDayCount = HUtil32.Str_ToInt(QuestConditionInfo.sParam3, -1);
                nValNo = M2Share.GetValNameNo(QuestConditionInfo.sParam4);
                nValNoDay = M2Share.GetValNameNo(QuestConditionInfo.sParam5);
                boDeleteExprie = (QuestConditionInfo.sParam6).ToLower().CompareTo(("清理").ToLower()) == 0;
                boNoCompareHumanName = (QuestConditionInfo.sParam6).ToLower().CompareTo(("1").ToLower()) == 0;
                cMethod = QuestConditionInfo.sParam2[0];
                if (nDayCount < 0)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKNAMEDATELIST);
                    return;
                }
                sListFileName = M2Share.g_Config.sEnvirDir + m_sPath + QuestConditionInfo.sParam1;
                if (File.Exists(sListFileName))
                {
                    LoadList = new TStringList();
                    try
                    {

                        LoadList.LoadFromFile(sListFileName);
                    }
                    catch
                    {
                        M2Share.MainOutMessage("加载失败.... => " + sListFileName);
                    }
                    if (LoadList.Count > 0)
                    {
                        for (I = 0; I < LoadList.Count; I++)
                        {
                            sLineText = LoadList[I].Trim();
                            sLineText = HUtil32.GetValidStr3(sLineText, ref sHumName, new string[] { " ", "\09" });
                            sLineText = HUtil32.GetValidStr3(sLineText, ref sDate, new string[] { " ", "\09" });
                            if (((sHumName).ToLower().CompareTo((PlayObject.m_sCharName).ToLower()) == 0) || boNoCompareHumanName)
                            {
                                nDay = Int32.MaxValue;
                                //if (TryStrToDateTime(sDate, dOldDate))
                                //{
                                //    nDay = HUtil32.GetDayCount(DateTime.Now, dOldDate);
                                //}
                                switch (cMethod)
                                {
                                    case '=':
                                        if (nDay == nDayCount)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case '>':
                                        if (nDay > nDayCount)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case '<':
                                        if (nDay < nDayCount)
                                        {
                                            result = true;
                                        }
                                        break;
                                    default:
                                        if (nDay >= nDayCount)
                                        {
                                            result = true;
                                        }
                                        break;
                                }
                                if (nValNo >= 0)
                                {
                                    switch (nValNo)
                                    {
                                        // Modify the A .. B: 0 .. 99
                                        case 0:
                                            PlayObject.m_nVal[nValNo] = nDay;
                                            break;
                                        // Modify the A .. B: 100 .. 199
                                        case 100:
                                            M2Share.g_Config.GlobalVal[nValNo - 100] = nDay;
                                            break;
                                        // Modify the A .. B: 200 .. 299
                                        case 200:
                                            PlayObject.m_DyVal[nValNo - 200] = nDay;
                                            break;
                                        // Modify the A .. B: 300 .. 399
                                        case 300:
                                            PlayObject.m_nMval[nValNo - 300] = nDay;
                                            break;
                                        // Modify the A .. B: 400 .. 499
                                        case 400:
                                            M2Share.g_Config.GlobaDyMval[nValNo - 400] = nDay;
                                            break;
                                        // Modify the A .. B: 500 .. 599
                                        case 500:
                                            PlayObject.m_nInteger[nValNo - 500] = nDay;
                                            break;
                                        // Modify the A .. B: 800 .. 1199
                                        case 800:
                                            // 20080903 G变量
                                            M2Share.g_Config.GlobalVal[nValNo - 700] = nDay;
                                            break;
                                    }
                                }
                                if (nValNoDay >= 0)
                                {
                                    switch (nValNoDay)
                                    {
                                        // Modify the A .. B: 0 .. 99
                                        case 0:
                                            PlayObject.m_nVal[nValNoDay] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 100 .. 199
                                        case 100:
                                            M2Share.g_Config.GlobalVal[nValNoDay - 100] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 200 .. 299
                                        case 200:
                                            PlayObject.m_DyVal[nValNoDay - 200] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 300 .. 399
                                        case 300:
                                            PlayObject.m_nMval[nValNoDay - 300] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 400 .. 499
                                        case 400:
                                            M2Share.g_Config.GlobaDyMval[nValNo - 400] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 500 .. 599
                                        case 500:
                                            PlayObject.m_nInteger[nValNo - 500] = nDayCount - nDay;
                                            break;
                                        // Modify the A .. B: 800 .. 1199
                                        case 800:
                                            // 20080903 G变量
                                            M2Share.g_Config.GlobalVal[nValNoDay - 700] = nDayCount - nDay;
                                            break;
                                    }
                                }
                                if (!result)
                                {
                                    if (boDeleteExprie)
                                    {
                                        LoadList.RemoveAt(I);
                                        try
                                        {

                                            LoadList.SaveToFile(sListFileName);
                                        }
                                        catch
                                        {
                                            M2Share.MainOutMessage("保存失败.... => " + sListFileName);
                                        }
                                    }
                                }
                                break;
                            }
                        }
                    }
                    Dispose(LoadList);
                }
                else
                {
                    M2Share.MainOutMessage("文件没有找到 => " + sListFileName);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckNameDateList");
            }
        }

        /// <summary>
        /// 检查地图人物数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckMapHumanCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nCount;
            int nHumanCount;
            char cMethod;
            string sMapName = string.Empty;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                if (nCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nCount))// 增加变量支持
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMAPHUMANCOUNT);
                        return;
                    }
                }
                if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sMapName))// 增加变量支持
                {
                    sMapName = QuestConditionInfo.sParam1;
                }
                nHumanCount = UserEngine.GetMapHuman(sMapName);
                cMethod = QuestConditionInfo.sParam2[1];
                switch (cMethod)
                {
                    case '=':
                        if (nHumanCount == nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (nHumanCount > nCount)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (nHumanCount < nCount)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (nHumanCount >= nCount)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMapHumanCount");
            }
        }

        /// <summary>
        /// 检查地图怪物数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckMapMonCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int nCount;
            int nMonCount;
            char cMethod;
            TEnvirnoment Envir;
            string sMap;
            List<TBaseObject> MonList;
            TBaseObject BaseObject;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("Self").ToLower()) == 0)
                {
                    sMap = PlayObject.m_sMapName;
                }
                else
                {
                    sMap = QuestConditionInfo.sParam1;
                    if ((sMap != "") && (sMap[0] == '<') && (sMap[1] == '$'))// 增加支持<$Str()>
                    {
                        sMap = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                    }
                    else
                    {
                        GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sMap);
                    }
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);
                if (nCount < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nCount);
                }
                if ((nCount < 0) || (Envir == null))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMAPMONCOUNT);
                    return;
                }
                MonList = new List<TBaseObject>();
                try
                {
                    UserEngine.GetMapMonster(Envir, MonList);
                    for (int I = MonList.Count - 1; I >= 0; I--)
                    {
                        if (MonList.Count <= 0)
                        {
                            break;
                        }
                        BaseObject = MonList[I];
                        if ((BaseObject.m_btRaceServer < Grobal2.RC_ANIMAL) || (BaseObject.m_btRaceServer == Grobal2.RC_ARCHERGUARD) ||
                            (BaseObject.m_Master != null) || (BaseObject.m_btRaceServer == Grobal2.RC_NPC) || (BaseObject.m_btRaceServer == Grobal2.RC_PEACENPC))
                        {
                            MonList.RemoveAt(I);
                        }
                    }
                    nMonCount = MonList.Count;
                    cMethod = QuestConditionInfo.sParam2[1];
                    switch (cMethod)
                    {
                        case '=':
                            if (nMonCount == nCount)
                            {
                                Result = true;
                            }
                            break;
                        case '>':
                            if (nMonCount > nCount)
                            {
                                Result = true;
                            }
                            break;
                        case '<':
                            if (nMonCount < nCount)
                            {
                                Result = true;
                            }
                            break;
                        default:
                            if (nMonCount >= nCount)
                            {
                                Result = true;
                            }
                            break;
                    }
                }
                finally
                {
                    Dispose(MonList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMapMonCount");
            }
        }

        /// <summary>
        /// 检查自定义变量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckVar(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            int I;
            string sType;
            string sVarName = string.Empty;
            string sVarValue = string.Empty;
            int nVarValue;
            string sName = string.Empty;
            string sMethod = string.Empty;
            char cMethod;
            TDynamicVar DynamicVar;
            bool boFoundVar = false;
            IList<TDynamicVar> DynamicVarList;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                sType = QuestConditionInfo.sParam1;
                sVarName = QuestConditionInfo.sParam2;
                sMethod = QuestConditionInfo.sParam3;
                nVarValue = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), 0);
                sVarValue = GetLineVariableText(PlayObject, QuestConditionInfo.sParam4);
                if ((sType == "") || (sVarName == "") || (sMethod == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKVAR);
                    return;
                }
                cMethod = sMethod[1];
                DynamicVarList = GetDynamicVarList(PlayObject, sType, ref sName);
                if (DynamicVarList == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKVAR);
                    return;
                }
                else
                {
                    if (DynamicVarList.Count > 0)
                    {
                        for (I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if (DynamicVar != null)
                            {
                                if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                                {
                                    switch (DynamicVar.VarType)
                                    {
                                        case TVarType.vInteger:
                                            switch (cMethod)
                                            {
                                                case '=':
                                                    if (DynamicVar.nInternet == nVarValue)
                                                    {
                                                        Result = true;
                                                    }
                                                    break;
                                                case '>':
                                                    if (DynamicVar.nInternet > nVarValue)
                                                    {
                                                        Result = true;
                                                    }
                                                    break;
                                                case '<':
                                                    if (DynamicVar.nInternet < nVarValue)
                                                    {
                                                        Result = true;
                                                    }
                                                    break;
                                                default:
                                                    if (DynamicVar.nInternet >= nVarValue)
                                                    {
                                                        Result = true;
                                                    }
                                                    break;
                                            }
                                            break;
                                        case TVarType.vString:
                                            switch (cMethod)
                                            {
                                                case '=':
                                                    if ((DynamicVar.sString).ToLower().CompareTo((sVarValue).ToLower()) == 0)
                                                    {
                                                        Result = true;
                                                    }
                                                    break;
                                            }
                                            break;
                                    }
                                    boFoundVar = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKVAR);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckVar");
            }
        }

        /// <summary>
        /// 检查服务器名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckServerName(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if (QuestConditionInfo.sParam1 == M2Share.g_Config.sServerName)
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckServerName");
            }
        }

        /// <summary>
        /// 检查当前所在地图的名字
        /// 格式:CHECKMAPNAME 人名(self) 地图号
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckMapName(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sCharName;
            string sMapName;
            TPlayObject OnlinePlayObject;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("Self").ToLower()) == 0)
                {
                    sCharName = PlayObject.m_sCharName;
                }
                else
                {
                    sCharName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                }
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                if (sCharName == PlayObject.m_sCharName)
                {
                    if (sMapName == PlayObject.m_sMapName)
                    {
                        Result = true;
                    }
                }
                else
                {
                    OnlinePlayObject = UserEngine.GetPlayObject(sCharName);
                    if (OnlinePlayObject != null)
                    {
                        if (OnlinePlayObject.m_sMapName == sMapName)
                        {
                            Result = true;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckMapName");
            }
        }

        /// <summary>
        /// 检查人物是否在安全区域内
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckSafeZone(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = PlayObject.InSafeZone();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSafeZone");
            }
        }

        /// <summary>
        /// 功能：检查人物技能等级
        /// CHECKSKILL 技能名称 控制符(=,>,<)  修炼等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe void ConditionOfCheckSkill(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            bool result = false;
            int nSkillLevel;
            char cMethod;
            TUserMagic* UserMagic;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                result = false;
                nSkillLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                if (nSkillLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nSkillLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKSKILL);
                        return;
                    }
                }
                UserMagic = null;
                UserMagic = PlayObject.GetMagicInfo(QuestConditionInfo.sParam1);
                if (UserMagic == null)
                {
                    return;
                }
                cMethod = QuestConditionInfo.sParam2[1];
                switch (cMethod)
                {
                    case '=':
                        if (UserMagic->btLevel == nSkillLevel)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (UserMagic->btLevel > nSkillLevel)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (UserMagic->btLevel < nSkillLevel)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (UserMagic->btLevel >= nSkillLevel)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckSkill");
            }
        }

        /// <summary>
        /// 检查字符串是否相等
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfAnsiContainsText(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sValue1;
            string sValue2;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                sValue1 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                sValue2 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                if ((sValue1.IndexOf(sValue2) != -1))
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfAnsiContainsText");
            }
        }

        /// <summary>
        /// 比较字符串是否一样
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCompareText(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            string sValue1 = string.Empty;
            string sValue2 = string.Empty;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sValue1);
                GetValValue(PlayObject, QuestConditionInfo.sParam2, ref sValue2);
                sValue1 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                sValue2 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                if (string.Compare(sValue1, sValue2, true) == 0)
                {
                    Result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCompareText");
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckTextList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            string s01 = QuestConditionInfo.sParam1;
            if ((s01 != "") && (s01[0] == '<') && (s01[1] == '$'))
            {
                s01 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
            }
            else
            {
                GetValValue(PlayObject, QuestConditionInfo.sParam1, ref s01);
            }
            string s02 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);// 路径支持变量
            if (s02[0] == '\\')
            {
                s02 = s02.Substring(2 - 1, s02.Length - 1);
            }
            if (s02[1] == '\\')
            {
                s02 = s02.Substring(3 - 1, s02.Length - 2);
            }
            if (s02[2] == '\\')
            {
                s02 = s02.Substring(4 - 1, s02.Length - 3);
            }
            if (!GotoLable_CheckStringList(s01, s02))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查当前玩家是否队伍队长
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfIsGroupMaster(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            if (PlayObject.m_GroupOwner != null)
            {
                if (PlayObject.m_GroupOwner != PlayObject)
                {
                    Result = false;
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 判断字符串包含在文件里
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheCkContAinsTextList(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            string s02 = string.Empty;
            string s01 = QuestConditionInfo.sParam1;
            GetValValue(PlayObject, QuestConditionInfo.sParam1, ref s01);
            if (QuestConditionInfo.sParam2[0] == '\\')
            {
                s02 = QuestConditionInfo.sParam2.Substring(2 - 1, QuestConditionInfo.sParam2.Length - 1);
            }
            if (QuestConditionInfo.sParam2[1] == '\\')
            {
                s02 = QuestConditionInfo.sParam2.Substring(3 - 1, QuestConditionInfo.sParam2.Length - 2);
            }
            if (QuestConditionInfo.sParam2[2] == '\\')
            {
                s02 = QuestConditionInfo.sParam2.Substring(4 - 1, QuestConditionInfo.sParam2.Length - 3);
            }
            s02 = GetLineVariableText(PlayObject, s02);
            if (!GotoLable_CheckAnsiContainsTextList(s01, s02))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查玩家是否在线
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfCheckOnLine(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            string s01 = QuestConditionInfo.sParam1;
            if ((s01 != "") && (s01[0] == '<') && (s01[1] == '$'))
            {
                s01 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
            }
            else
            {
                GetValValue(PlayObject, QuestConditionInfo.sParam1, ref s01);
            }
            if ((s01 == "") || (UserEngine.GetPlayObject(s01) == null))
            {
                Result = false;
            }
        }

        /// <summary>
        /// 检查人物是否重叠
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <param name="Result"></param>
        private void ConditionOfIsDupMode(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            if (PlayObject.m_PEnvir != null)
            {
                if (PlayObject.m_PEnvir.GetXYObjCount(PlayObject.m_nCurrX, PlayObject.m_nCurrY) <= 1)
                {
                    Result = false;
                }
            }
            else
            {
                Result = false;
            }
        }

        /// <summary>
        /// 功能:查检金刚石
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckGameDiaMond(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nGameDiaMond;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nGameDiaMond = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGameDiaMond < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGameDiaMond))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGAMEDIAMOND);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nGAMEDIAMOND == nGameDiaMond)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nGAMEDIAMOND > nGameDiaMond)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nGAMEDIAMOND < nGameDiaMond)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nGAMEDIAMOND >= nGameDiaMond)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGameDiaMond");
            }
        }

        /// <summary>
        /// 功能:查检灵符
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private void ConditionOfCheckGameGird(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, ref bool Result)
        {
            Result = false;
            char cMethod;
            int nGameGird;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Result = false;
                nGameGird = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGameGird < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGameGird))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGAMEGIRD);
                        return;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nGAMEGIRD == nGameGird)
                        {
                            Result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nGAMEGIRD > nGameGird)
                        {
                            Result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nGAMEGIRD < nGameGird)
                        {
                            Result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nGAMEGIRD >= nGameGird)
                        {
                            Result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGameGird");
            }
        }

        private void ActionOfAddNameDateList(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TStringList LoadList;
            bool boFound;
            string sListFileName;
            string sLineText;
            string sHumName = string.Empty;
            string sDate = string.Empty;
            sListFileName = M2Share.g_Config.sEnvirDir + m_sPath + QuestActionInfo.sParam1;
            LoadList = new TStringList();
            if (File.Exists(sListFileName))
            {
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败.... => " + sListFileName);
                }
            }
            try
            {
                boFound = false;
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        sLineText = LoadList[I].Trim();
                        sLineText = HUtil32.GetValidStr3(sLineText, ref sHumName, new string[] { " ", "\09" });
                        sLineText = HUtil32.GetValidStr3(sLineText, ref sDate, new string[] { " ", "\09" });
                        if ((sHumName).ToLower().CompareTo((PlayObject.m_sCharName).ToLower()) == 0)
                        {
                            LoadList[I] = PlayObject.m_sCharName + "\09" + (DateTime.Today).ToString();
                            boFound = true;
                            break;
                        }
                    }
                }
                if (!boFound)
                {
                    //LoadList.Add(PlayObject.m_sCharName + "\09" + (DateTime.Today).ToString());
                }
                LoadList.SaveToFile(sListFileName);
            }
            catch
            {
                M2Share.MainOutMessage("文件保存失败 => " + sListFileName);
            }
            Dispose(LoadList);
        }

        private void ActionOfDelNameDateList(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TStringList LoadList;
            string sLineText;
            string sListFileName;
            string sHumName = string.Empty;
            string sDate = string.Empty;
            bool boFound;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            sListFileName = M2Share.g_Config.sEnvirDir + m_sPath + QuestActionInfo.sParam1;
            LoadList = new TStringList();
            if (File.Exists(sListFileName))
            {
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败.... => " + sListFileName);

                    return;
                }
            }
            boFound = false;
            if (LoadList.Count > 0)
            {
                for (int I = 0; I < LoadList.Count; I++)
                {
                    sLineText = LoadList[I].Trim();
                    sLineText = HUtil32.GetValidStr3(sLineText, ref sHumName, new string[] { " ", "\09" });
                    sLineText = HUtil32.GetValidStr3(sLineText, ref sDate, new string[] { " ", "\09" });
                    if ((sHumName).ToLower().CompareTo((PlayObject.m_sCharName).ToLower()) == 0)
                    {
                        LoadList.RemoveAt(I);
                        boFound = true;
                        break;
                    }
                }
            }
            if (boFound)
            {
                try
                {

                    LoadList.SaveToFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件保存失败  => " + sListFileName);
                }
            }
            Dispose(LoadList);
            LoadList.Dispose();
        }
        
        /// <summary>
        /// 功能：脚本增加技能。
        /// 格式：ADDSKILL 技能名称 技能等级 HERO  (加参数HERO,即是增加英雄技能)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfAddSkill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TMagic* Magic;
            TUserMagic* UserMagic = null;
            int nLevel;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nLevel = HUtil32._MIN(3, HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0));
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ADDSKILL);
                        return;
                    }
                    Magic = UserEngine.FindHeroMagic(QuestActionInfo.sParam1);
                    if (Magic != null)
                    {
                        if (PlayObject.m_MyHero != null)
                        {
                            if (!PlayObject.m_MyHero.IsTrainingSkill(Magic->wMagicId))
                            {
                                if ((HUtil32.SBytePtrToString(Magic->sDescr, 0, Magic->DescrLen) == "内功") &&
                                    (!((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)) // 没有内功心法,则不能学内功技能
                                {
                                    return;
                                }
                                if (HUtil32.SBytePtrToString(Magic->sDescr, 0, Magic->DescrLen) == "连击")
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_boCanUseBatter = true;
                                }
                                UserMagic->MagicInfo = *Magic;
                                UserMagic->wMagIdx = Magic->wMagicId;
                                UserMagic->btKey = 0;
                                UserMagic->btLevel = (byte)nLevel;
                                UserMagic->nTranPoint = 0;
                                PlayObject.m_MyHero.m_MagicList.Add((IntPtr)UserMagic);
                                ((THeroObject)(PlayObject.m_MyHero)).SendAddMagic(UserMagic);
                                ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                                PlayObject.m_MyHero.CompareSuitItem(false);//套装
                                PlayObject.HeroAddSkillFunc(Magic->wMagicId);// 英雄学技能触发 
                                if (M2Share.g_Config.boShowScriptActionMsg)
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).SysMsg("[英雄] " + HUtil32.SBytePtrToString(Magic->sMagicName, 0, Magic->MagicNameLen)
                                        + "练习成功。", TMsgColor.c_Green, TMsgType.t_Hint);
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ADDSKILL);
                    }
                }
                else
                {
                    Magic = UserEngine.FindMagic(QuestActionInfo.sParam1);
                    if (Magic != null)
                    {
                        if (!PlayObject.IsTrainingSkill(Magic->wMagicId))
                        {
                            if ((HUtil32.SBytePtrToString(Magic->sDescr, 0, Magic->DescrLen) == "内功") && (!PlayObject.m_boTrainingNG)) // 没有内功心法,则不能学内功技能
                            {
                                return;
                            }
                            if (HUtil32.SBytePtrToString(Magic->sDescr, 0, Magic->DescrLen) == "连击")
                            {
                                PlayObject.m_boCanUseBatter = true;
                            }
                            UserMagic->MagicInfo = *Magic;
                            UserMagic->wMagIdx = Magic->wMagicId;
                            UserMagic->btKey = 0;
                            UserMagic->btLevel = (byte)nLevel;
                            UserMagic->nTranPoint = 0;
                            PlayObject.m_MagicList.Add((IntPtr)UserMagic);
                            PlayObject.SendAddMagic(UserMagic);
                            PlayObject.RecalcAbilitys();
                            PlayObject.CompareSuitItem(false);// 套装
                            PlayObject.AddSkillFunc(Magic->wMagicId);// 人物学技能触发 
                            if (M2Share.g_Config.boShowScriptActionMsg)
                            {
                                PlayObject.SysMsg(HUtil32.SBytePtrToString(Magic->sMagicName, 0, Magic->MagicNameLen) + "练习成功。", TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ADDSKILL);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAddSkill");
            }
        }

        /// <summary>
        /// 功能：添加行会成员
        /// 格式：ADDGUILDMEMBER 行会名称 人物名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfADDGUILDMEMBER(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sGuildName;
            string UserName;
            TGUild Guild;
            TPlayObject PlayHum;
            try
            {
                sGuildName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                UserName = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);
                if ((sGuildName == "") || (UserName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ADDGUILDMEMBER);
                    return;
                }
                PlayHum = UserEngine.GetPlayObject(UserName);
                Guild = GuildManager.FindGuild(sGuildName);
                if (Guild != null)
                {
                    if ((PlayHum != null) && (!PlayHum.m_boNotOnlineAddExp))// 人物存在,不是离线挂机,允许加入行会
                    {
                        if (!Guild.IsMember(UserName))// 不是行会成员
                        {
                            if ((PlayHum.m_MyGuild == null) && (Guild.m_RankList.Count < Guild.m_nGuildMemberCount))// 人物没有行会,并且要加入的行会人员没有满
                            {
                                Guild.AddMember(PlayHum);
                                UserEngine.SendServerGroupMsg(Grobal2.SS_207, M2Share.nServerIndex, Guild.sGuildName);
                                PlayHum.m_MyGuild = Guild;
                                PlayHum.m_sGuildRankName = Guild.GetRankName(PlayHum, ref PlayHum.m_nGuildRankNo);
                                PlayHum.RefShowName();
                                PlayHum.SysMsg("您已加入行会: " + Guild.sGuildName + " 当前封号为: " + PlayHum.m_sGuildRankName, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                        }
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ADDGUILDMEMBER);
                    return;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfADDGUILDMEMBER");
            }
        }

        /// <summary>
        /// 功能：删除行会成员（删除掌门无效
        /// 格式：DELGUILDMEMBER 行会名称 人物名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfDelGuildMember(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sGuildName;
            string UserName;
            TGUild Guild;
            TPlayObject PlayHum;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sGuildName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                UserName = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);
                if ((sGuildName == "") || (UserName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELGUILDMEMBER);
                    return;
                }
                PlayHum = UserEngine.GetPlayObject(UserName);
                Guild = GuildManager.FindGuild(sGuildName);
                if (Guild != null)
                {
                    if ((PlayHum != null) && (!PlayHum.m_boNotOnlineAddExp))// 人物存在,不是离线挂机,允许加入行会
                    {
                        if (Guild.IsMember(UserName) && (PlayHum.m_nGuildRankNo != 1))// 是行会成员
                        {
                            if (Guild.DelMember(UserName))//从行会中删除
                            {
                                PlayHum.m_MyGuild = null;
                                PlayHum.RefRankInfo(0, "");
                                PlayHum.RefShowName();
                                UserEngine.SendServerGroupMsg(Grobal2.SS_207, M2Share.nServerIndex, Guild.sGuildName);
                            }
                        }
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELGUILDMEMBER);
                    return;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDELGUILDMEMBER");
            }
        }

        private void ActionOfAutoAddGameGold(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo, int nPoint, uint nTime)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("START").ToLower()) == 0)
                {
                    if ((nPoint > 0) && (nTime > 0))
                    {
                        PlayObject.m_nIncGameGold = nPoint;
                        PlayObject.m_dwIncGameGoldTime = nTime * 1000;

                        PlayObject.m_dwIncGameGoldTick = HUtil32.GetTickCount();
                        PlayObject.m_boIncGameGold = true;
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("STOP").ToLower()) == 0)
                {
                    PlayObject.m_boIncGameGold = false;
                    return;
                }
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_AUTOADDGAMEGOLD);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAutoAddGameGold");
            }
        }

        /// <summary>
        /// SETAUTOGETEXP 时间 点数 是否安全区 地图号
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfAutoGetExp(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nTime;
            int nPoint;
            bool boIsSafeZone;
            string sMAP;
            TEnvirnoment Envir;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Envir = null;
                nTime = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                nPoint = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                boIsSafeZone = QuestActionInfo.sParam3[1] == '1';
                sMAP = QuestActionInfo.sParam4;
                if (sMAP != "")
                {
                    Envir = M2Share.g_MapManager.FindMap(sMAP);
                }
                if ((nTime <= 0) || (nPoint <= 0) || ((sMAP != "") && (Envir == null)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETAUTOGETEXP);
                    return;
                }
                PlayObject.m_boAutoGetExpInSafeZone = boIsSafeZone;
                PlayObject.m_AutoGetExpEnvir = Envir;
                PlayObject.m_nAutoGetExpTime = nTime * 1000;
                PlayObject.m_nAutoGetExpPoint = (uint)nPoint;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAutoGetExp");
            }
        }

        private void ActionOfAutoSubGameGold(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo, int nPoint, int nTime)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("START").ToLower()) == 0)
                {
                    if ((nPoint > 0) && (nTime > 0))
                    {
                        PlayObject.m_nDecGameGold = nPoint;
                        PlayObject.m_dwDecGameGoldTime = ((uint)nTime * 1000);
                        PlayObject.m_dwDecGameGoldTick = 0;
                        PlayObject.m_boDecGameGold = true;
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("STOP").ToLower()) == 0)
                {
                    PlayObject.m_boDecGameGold = false;
                    return;
                }
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_AUTOSUBGAMEGOLD);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAutoSubGameGold");
            }
        }

        /// <summary>
        /// 功能:记路标石 
        /// 格式:TAGMAPINFO 记路(1-6)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfTAGMAPINFO(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nTpye;
            byte I;
            IniFile IniFile;
            string sFileName;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nTpye = (byte)QuestActionInfo.nParam1;
                if ((nTpye <= 0) || (nTpye > 6))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_TAGMAPINFO);
                    return;
                }
                PlayObject.m_TagMapInfos[nTpye].TagMapName = PlayObject.m_sMapName;
                PlayObject.m_TagMapInfos[nTpye].TagX = PlayObject.m_nCurrX;
                PlayObject.m_TagMapInfos[nTpye].TagY = PlayObject.m_nCurrY;// 保存到文件里
                sFileName = M2Share.g_Config.sEnvirDir + "UserData";
                if (!Directory.Exists(sFileName))
                {
                    Directory.CreateDirectory(sFileName); // 目录不存在,则创建
                }
                sFileName = sFileName + "\\HumRecallPoint.txt";
                IniFile = new IniFile(sFileName);
                try
                {
                    for (I = 1; I <= 6; I++)
                    {
                        IniFile.WriteString(PlayObject.m_sCharName, "记录" + (I).ToString(), PlayObject.m_TagMapInfos[I].TagMapName + ","
                            + (PlayObject.m_TagMapInfos[I].TagX).ToString() + "," + (PlayObject.m_TagMapInfos[I].TagY).ToString());
                    }
                }
                finally
                {
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTAGMAPINFO");
            }
        }

        /// <summary>
        /// 功能:移动到记路标石记录的地图XY
        /// 格式: TAGMAPMOVE 记路(1-6)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfTAGMAPMOVE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nTpye;
            TEnvirnoment Envir;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nTpye = (byte)QuestActionInfo.nParam1;
                if ((nTpye <= 0) || (nTpye > 6))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_TAGMAPMOVE);
                    return;
                }
                if ((PlayObject.m_TagMapInfos[nTpye].TagX != 0) || (PlayObject.m_TagMapInfos[nTpye].TagY != 0))
                {
                    Envir = M2Share.g_MapManager.FindMap(PlayObject.m_TagMapInfos[nTpye].TagMapName);
                    if (Envir != null)
                    {
                        if (Envir.CanWalk(PlayObject.m_TagMapInfos[nTpye].TagX, PlayObject.m_TagMapInfos[nTpye].TagY, true))
                        {
                            PlayObject.SpaceMove(PlayObject.m_TagMapInfos[nTpye].TagMapName, PlayObject.m_TagMapInfos[nTpye].TagX, PlayObject.m_TagMapInfos[nTpye].TagY, 0);
                        }
                        else
                        {
                            PlayObject.SysMsg(string.Format(GameMsgDef.g_sGameCommandPositionMoveCanotMoveToMap1, PlayObject.m_TagMapInfos[nTpye].TagMapName, 
                                PlayObject.m_TagMapInfos[nTpye].TagX, PlayObject.m_TagMapInfos[nTpye].TagY), TMsgColor.c_Green, TMsgType.t_Hint);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTAGMAPMOVE");
            }
        }
    
        /// <summary>
        /// 功能：调整行会成员上限
        /// 格式：CHANGEGUILDMEMBERCOUNT +\-\= 人数(65535)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHANGEGUILDMEMBERCOUNT(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMemberCount;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMemberCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nMemberCount < 0) || (nMemberCount > 65535))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGUILDMEMBERCOUNT);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                if (PlayObject.m_MyGuild != null)
                {
                    switch (cMethod)
                    {
                        case '=':
                            if (nMemberCount >= 0)
                            {
                                PlayObject.m_MyGuild.m_nGuildMemberCount = (ushort)nMemberCount;
                                PlayObject.m_MyGuild.SaveGuildInfoFile();// 保存行会文件
                            }
                            break;
                        case '-':
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount > nMemberCount)
                            {
                                PlayObject.m_MyGuild.m_nGuildFountain -= nMemberCount;
                            }
                            else
                            {
                                PlayObject.m_MyGuild.m_nGuildMemberCount = 0;
                            }
                            PlayObject.m_MyGuild.SaveGuildInfoFile(); // 保存行会文件
                            break;
                        case '+':
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount + nMemberCount > ushort.MaxValue)
                            {
                                PlayObject.m_MyGuild.m_nGuildMemberCount = ushort.MaxValue;
                            }
                            else
                            {
                                PlayObject.m_MyGuild.m_nGuildMemberCount += (ushort)nMemberCount;
                            }
                            PlayObject.m_MyGuild.SaveGuildInfoFile();// 保存行会文件
                            break;
                        default:
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGUILDMEMBERCOUNT);
                            return;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGEGUILDMEMBERCOUNT");
            }
        }

        /// <summary>
        /// 功能：行会酒泉数据的调整
        /// 格式：CHANGEGUILDFOUNTAIN +\-\= 点数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHANGEGUILDFOUNTAIN(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nPoint;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nPoint < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGUILDFOUNTAIN);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                if (PlayObject.m_MyGuild != null)
                {
                    switch (cMethod)
                    {
                        case '=':
                            if (nPoint >= 0)
                            {
                                PlayObject.m_MyGuild.m_nGuildFountain = nPoint;
                                PlayObject.m_MyGuild.SaveGuildInfoFile();// 保存行会文件
                            }
                            break;
                        case '-':
                            if (PlayObject.m_MyGuild.m_nGuildFountain > nPoint)
                            {
                                PlayObject.m_MyGuild.m_nGuildFountain -= nPoint;
                            }
                            else
                            {
                                PlayObject.m_MyGuild.m_nGuildFountain = 0;
                            }
                            PlayObject.m_MyGuild.SaveGuildInfoFile();
                            break;
                        case '+':// 保存行会文件
                            PlayObject.m_MyGuild.m_nGuildFountain += nPoint;
                            PlayObject.m_MyGuild.SaveGuildInfoFile();
                            break;
                        default:
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGUILDFOUNTAIN);
                            return;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGEGUILDFOUNTAIN");
            }
        }

        /// <summary>
        /// 功能：调整声望
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeCreditPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nCreditPoint;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nCreditPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nCreditPoint < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nCreditPoint)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CREDITPOINT);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (nCreditPoint >= 0)
                        {
                            PlayObject.m_btCreditPoint = (UInt16)nCreditPoint;
                        }
                        break;
                    case '-':
                        if (PlayObject.m_btCreditPoint > nCreditPoint)
                        {
                            PlayObject.m_btCreditPoint -= (UInt16)nCreditPoint;
                        }
                        else
                        {
                            PlayObject.m_btCreditPoint = 0;
                        }
                        break;
                    case '+':
                        PlayObject.m_btCreditPoint += (UInt16)nCreditPoint;
                        break;
                    default:
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CREDITPOINT);
                        return;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeCreditPoint");
            }
        }

        /// <summary>
        /// 功能：调整荣誉值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeCreditGlory(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGameGlory;
            int nOldGameGlory;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldGameGlory = PlayObject.m_btGameGlory;
                nGameGlory = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nGameGlory < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nGameGlory)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GAMEGLORY);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nGameGlory >= 0))
                        {
                            PlayObject.m_btGameGlory = (byte)nGameGlory;
                        }
                        break;
                    case '-':
                        PlayObject.m_btGameGlory = (byte)HUtil32._MAX(0, PlayObject.m_btGameGlory - nGameGlory);
                        break;
                    case '+':
                        PlayObject.m_btGameGlory = (byte)HUtil32._MIN(Byte.MaxValue, PlayObject.m_btGameGlory + nGameGlory);
                        break;
                }
                if (M2Share.g_boGameLogGameGlory)
                {
                    M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GameGlory, PlayObject.m_sMapName, 
                        PlayObject.m_nCurrX, PlayObject.m_nCurrY, PlayObject.m_sCharName, M2Share.g_Config.sGameGlory, PlayObject.m_btGameGlory, cMethod 
                        + "(" + (nGameGlory).ToString() + ")", this.m_sCharName));
                }
                if (nOldGameGlory != PlayObject.m_btGameGlory)
                {
                    PlayObject.GameGloryChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeCreditGlory");
            }
        }

        /// <summary>
        /// 功能：调整经验 英雄存在,则按比配分经验给英雄
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfChangeExp(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            UInt32 nExp;
            char cMethod;
            UInt32 dwInt;
            byte nCode;
            nCode = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject == null)
                {
                    return;
                }
                nCode = 1;
                nExp = (UInt32)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nExp < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEEXP);
                    return;
                }
                nCode = 2;
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        nCode = 3;
                        if (nExp >= 0)
                        {
                            if (PlayObject.m_Abil.Level < M2Share.g_Config.nLimitExpLevel)  // 是否超过限制等级
                            {
                                nCode = 4;
                                PlayObject.m_Abil.Exp = nExp;
                            }
                            else
                            {
                                nCode = 5;
                                PlayObject.m_Abil.Exp = M2Share.g_Config.nLimitExpValue;
                            }
                        }
                        break;
                    case '-':
                        nCode = 6;
                        if (PlayObject.m_Abil.Exp > nExp)
                        {
                            nCode = 7;
                            PlayObject.m_Abil.Exp -= nExp;
                        }
                        else
                        {
                            nCode = 8;
                            PlayObject.m_Abil.Exp = 0;
                        }
                        break;
                    case '+':
                        nCode = 9;
                        if (PlayObject.m_Abil.Level < M2Share.g_Config.nLimitExpLevel) // 是否超过限制等级
                        {
                            nCode = 10;
                            dwInt = nExp;
                            if (PlayObject.m_Abil.Exp >= nExp)
                            {
                                if ((int.MaxValue - PlayObject.m_Abil.Exp) < nExp)
                                {
                                    dwInt = UInt32.MaxValue - PlayObject.m_Abil.Exp;
                                }
                            }
                            else
                            {
                                if ((int.MaxValue - nExp) < PlayObject.m_Abil.Exp)
                                {
                                    dwInt = UInt32.MaxValue - nExp;
                                }
                            }
                        }
                        else
                        {
                            dwInt = M2Share.g_Config.nLimitExpValue;
                        }
                        nCode = 11;
                        PlayObject.GetExpToItem(dwInt);
                        nCode = 12;
                        if (PlayObject.m_MyHero != null)
                        {
                            nCode = 13;
                            ((THeroObject)(PlayObject.m_MyHero)).GetExp((uint)Math.Abs(HUtil32.Round((double)(M2Share.g_Config.nHeroNoKillMonExpRate / 100) * dwInt)));
                            nCode = 14;
                            dwInt = (uint)Math.Abs(HUtil32.Round((double)((100 - M2Share.g_Config.nHeroNoKillMonExpRate) / 100) * dwInt));
                        }
                        nCode = 15;
                        PlayObject.m_GetExp = dwInt;// 人物取得的经验,$GetExp变量使用
                        if (M2Share.g_FunctionNPC != null)
                        {
                            M2Share.g_FunctionNPC.GotoLable(PlayObject, "@GetExp", false); // 取经验触发
                        }
                        PlayObject.m_Abil.Exp += dwInt;
                        PlayObject.SendMsg(PlayObject, Grobal2.RM_WINEXP, 0, (int)dwInt, 0, 0, "");
                        PlayObject.GetExpToCrystal(dwInt, 0);// 取经验到天地结晶中
                        nCode = 16;
                        if (PlayObject.m_Abil.Exp >= PlayObject.m_Abil.MaxExp)
                        {
                            PlayObject.m_Abil.Exp -= PlayObject.m_Abil.MaxExp;
                            nCode = 17;
                            if ((PlayObject.m_Abil.Level < M2Share.MAXUPLEVEL) && (PlayObject.m_Abil.Level < M2Share.g_Config.nLimitExpLevel))
                            {
                                PlayObject.m_Abil.Level++;
                            }
                            // 增加限制等级
                            if (PlayObject.m_Abil.Level < M2Share.g_Config.nLimitExpLevel)
                            {
                                PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);
                            }
                            // 增加限制等级
                            // 人物升级记录日志
                            M2Share.AddGameDataLog("12" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_Abil.Level).ToString()
                                + "\09" + (PlayObject.m_Abil.Exp).ToString() + "/" + (PlayObject.m_Abil.MaxExp).ToString() + "\09" + this.m_sCharName
                                + "\09" + "0" + "\09" + "0" + "\09" + "1" + "\09" + "(调整经验)");
                        }
                        nCode = 18;
                        if (PlayObject.m_Magic68Skill != null)
                        {
                            // 学过酒气护体
                            if (PlayObject.m_Magic68Skill->btLevel < 100)
                            {
                                PlayObject.m_Exp68 += (UInt16)dwInt;
                            }
                            nCode = 19;
                            if (PlayObject.m_Exp68 >= PlayObject.m_MaxExp68)
                            {
                                // 超过升级经验,则升级技能
                                PlayObject.m_Exp68 -= PlayObject.m_MaxExp68;
                                nCode = 20;
                                if (PlayObject.m_Magic68Skill->btLevel < 100)
                                {
                                    PlayObject.m_Magic68Skill->btLevel++;
                                }
                                PlayObject.m_MaxExp68 = (UInt16)PlayObject.GetSkill68Exp(PlayObject.m_Magic68Skill->btLevel);
                                PlayObject.SendDelayMsg(PlayObject, Grobal2.RM_MAGIC_LVEXP, 0, PlayObject.m_Magic68Skill->MagicInfo.wMagicId, PlayObject.m_Magic68Skill->btLevel, PlayObject.m_Magic68Skill->nTranPoint, "", 100);
                            }
                            nCode = 21;
                            if (PlayObject.m_Magic68Skill->btLevel < 100)
                            {
                                //PlayObject.SendMsg(PlayObject, Grobal2.RM_MAGIC68SKILLEXP, 0, 0, 0, 0, EDcode.Units.EDcode.EncodeString((PlayObject.m_Exp68).ToString() + "/" + (PlayObject.m_MaxExp68).ToString()));
                            }
                            // 发送酒气护体经验
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeExp Code:" + (nCode).ToString());
            }
        }

        /// <summary>
        /// 功能:调整内功经验 
        /// 格式:CHANGENGEXP 控制符(=,+,-) 经验点数 Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeNGExp(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            UInt32 nExp;
            char cMethod;
            UInt32 dwInt;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nExp = (UInt32)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nExp < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGENGEXP);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (!((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                        {
                            return;
                        }
                        switch (cMethod)
                        {
                            case '=':
                                if (nExp >= 0)
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 = nExp;
                                }
                                PlayObject.m_MyHero.SendNGData();
                                break;
                            case '-':// 发送内功数据
                                if (((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 > nExp)
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 -= nExp;
                                }
                                else
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 = 0;
                                }
                                PlayObject.m_MyHero.SendNGData();
                                break;
                            case '+':// 发送内功数据
                                dwInt = nExp;
                                ((THeroObject)(PlayObject.m_MyHero)).GetNGExp(dwInt, 1);
                                break;
                        }
                    }
                }
                else
                {
                    if (!PlayObject.m_boTrainingNG)
                    {
                        return;
                    }
                    switch (cMethod)
                    {
                        case '=':
                            if (nExp >= 0)
                            {
                                PlayObject.m_ExpSkill69 = nExp;
                            }
                            PlayObject.SendNGData();
                            break;
                        case '-':// 发送内功数据
                            if (PlayObject.m_ExpSkill69 > nExp)
                            {
                                PlayObject.m_ExpSkill69 -= nExp;
                            }
                            else
                            {
                                PlayObject.m_ExpSkill69 = 0;
                            }
                            PlayObject.SendNGData();
                            break;
                        case '+':// 发送内功数据
                            dwInt = nExp;
                            PlayObject.GetNGExp(dwInt, 1);
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeNGExp");
            }
        }

        /// <summary>
        /// 调整内功经验 
        /// 功能:调整人物内力等级 
        /// 格式:CHANGENGLEVEL 控制符(=,+,-) 等级数(1-255) Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHANGENGLEVEL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nLv;
            byte nLEVEL;
            bool boChgOK;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                boChgOK = false;
                nLEVEL = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nLEVEL < 0) || (nLEVEL > 255))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGENGLEVEL);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (!((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                        {
                            return;
                        }
                        switch (cMethod)
                        {
                            case '=':
                                if ((nLEVEL > 0) && (nLEVEL <= 255))
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel = nLEVEL;
                                    boChgOK = true;
                                }
                                break;
                            case '-':
                                nLv = (byte)HUtil32._MAX(0, ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel - nLEVEL);
                                ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel = nLv;
                                boChgOK = true;
                                break;
                            case '+':
                                nLv = (byte)HUtil32._MIN(255, ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel + nLEVEL);
                                ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel = nLv;
                                boChgOK = true;
                                break;
                        }
                        if (boChgOK)
                        {
                            PlayObject.m_MyHero.SendNGData();// 发送内功数据
                            // 等级调整记录日志
                            M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_MyHero.m_sMapName + "\09" + (PlayObject.m_MyHero.m_nCurrX).ToString()
                                + "\09" + (PlayObject.m_MyHero.m_nCurrY).ToString() + "\09" + PlayObject.m_MyHero.m_sCharName + "\09"
                                + (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel).ToString() + "\09" + "英雄内功" + "\09" + cMethod + "(" + (nLEVEL).ToString()
                                + ")" + "\09" + this.m_sCharName);
                        }
                    }
                }
                else
                {
                    if (!PlayObject.m_boTrainingNG)
                    {
                        return;
                    }
                    switch (cMethod)
                    {
                        case '=':
                            if ((nLEVEL > 0) && (nLEVEL <= 255))
                            {
                                PlayObject.m_NGLevel = nLEVEL;
                                boChgOK = true;
                            }
                            break;
                        case '-':
                            nLv = (byte)HUtil32._MAX(0, PlayObject.m_NGLevel - nLEVEL);
                            PlayObject.m_NGLevel = nLv;
                            boChgOK = true;
                            break;
                        case '+':
                            nLv = (byte)HUtil32._MIN(255, PlayObject.m_NGLevel + nLEVEL);
                            PlayObject.m_NGLevel = nLv;
                            boChgOK = true;
                            break;
                    }
                    if (boChgOK)
                    {
                        PlayObject.SendNGData();// 发送内功数据
                        // 等级调整记录日志
                        M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09"
                            + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_NGLevel).ToString()
                            + "\09" + "内功" + "\09" + cMethod + "(" + (nLEVEL).ToString() + ")" + "\09" + this.m_sCharName);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGENGLEVEL");
            }
        }

        /// <summary>
        /// 调整内功等级
        /// 功能：客户端显示天地结晶图标
        /// 格式：OPENEXPCRYSTAL
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfOPENEXPCRYSTAL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_boShowExpCrystal = true;// 是否显示天地结晶图标 
                PlayObject.m_CrystalLevel = 1;// 天地结晶等级 
                PlayObject.m_CrystalExp = 0;// 天地结晶当前经验 
                PlayObject.m_CrystalMaxExp = 0;// 天地结晶升级经验 
                PlayObject.m_CrystalNGExp = 0;// 天地结晶当前内功经验 
                PlayObject.m_CrystalNGMaxExp = 0;// 天地结晶内功升级经验 
                PlayObject.m_boGetExpCrystalExp = false;// 是否可以提取经验 
                PlayObject.m_nGetCrystalExp = 0;// 可提取天地结晶经验 
                PlayObject.m_nGetCrystalNGExp = 0;// 天可提取地结晶内功经验 
                PlayObject.SendMsg(PlayObject, Grobal2.RM_OPENEXPCRYSTAL, 0, 2, 0, 0, "");// 发消息显示天地结晶图标
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENEXPCRYSTAL");
            }
        }

        /// <summary>
        /// 客户端显示天地结晶
        /// 功能：客户端关闭天地结晶图标
        /// 格式：CLOSEEXPCRYSTAL
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCLOSEEXPCRYSTAL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_boShowExpCrystal)
                {
                    PlayObject.m_boShowExpCrystal = false;// 是否显示天地结晶图标 
                    PlayObject.m_CrystalLevel = 1;// 天地结晶等级 
                    PlayObject.m_CrystalExp = 0;// 天地结晶当前经验 
                    PlayObject.m_CrystalMaxExp = 0;// 天地结晶升级经验 
                    PlayObject.m_CrystalNGExp = 0;// 天地结晶当前内功经验 
                    PlayObject.m_CrystalNGMaxExp = 0;// 天地结晶内功升级经验 
                    PlayObject.m_boGetExpCrystalExp = false;// 是否可以提取经验 
                    PlayObject.m_nGetCrystalExp = 0;// 可提取天地结晶经验 
                    PlayObject.m_nGetCrystalNGExp = 0;// 天可提取地结晶内功经验 
                    PlayObject.SendMsg(PlayObject, Grobal2.RM_OPENEXPCRYSTAL, 0, 1, 0, 0, "");// 发消息关闭天地结晶图标
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCLOSEEXPCRYSTAL");
            }
        }

        /// <summary>
        /// 客户端关闭天地结晶
        /// 功能：取提天地结晶中的经验(只提取可提取的经验)
        /// 格式：GETEXPTOCRYSTAL
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGETEXPTOCRYSTAL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.ClientGetExpTCrystal();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETEXPTOCRYSTAL");
            }
        }

        /// <summary>
        /// 取提天地结晶中的经验(只提取可提取的经验)
        /// 功能：时间到触发QF段
        /// 格式：SENDTIMEMSG 消息内容 时间 字颜色 QF触发段
        /// 例：SENDTIMEMSG 火龙殿任务还剩%s秒结束... 300 251 @触发测试
        /// 说明：300代表时间(秒)  251代表颜色 @触发测试 触发QFunction-0.txt
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        /// </summary>
        private void ActionOfSENDTIMEMSG(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nTime;
            byte FColor;
            string sQFStr;
            string sMsg;
            bool boForMapShowHint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMsg = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                nTime = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// 时间(秒)
                FColor = (byte)HUtil32._MIN(255, HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0));// 字颜色
                sQFStr = GetLineVariableText(PlayObject, QuestActionInfo.sParam4);// 触发QFunction-0.txt段
                boForMapShowHint = HUtil32.Str_ToInt(QuestActionInfo.sParam5, 0) != 0;// 换地图是否还显示倒计时信息
                if ((sMsg == "") || (sQFStr == "") || (nTime < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SENDTIMEMSG);
                    return;
                }

                PlayObject.m_dwUserTick[0] = (uint)nTime;// 设置人物的时间
                PlayObject.m_sMapQFStr = sQFStr;// SENDTIMEMSG命令设置的触发段 
                PlayObject.m_boForMapShowHint = boForMapShowHint;// 换地图是否还显示倒计时信息 
                PlayObject.m_dwUserTick[3] = 0;// 发送显示信息给客户端
                PlayObject.SendMsg(PlayObject, Grobal2.RM_MOVEMESSAGE, 2, FColor, 0, nTime, sMsg);// 客户端显示倒计时(快捷键上方显示) 倒记时消息
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSENDTIMEMSG");
            }
        }

        /// <summary>
        /// 时间到触发QF段(客户端显示信息)
        /// 功能：时间到后进入QFunction-0.txt 指定的触发段,发消息给客户端显示'!'号图标
        /// 格式：SENDMSGWINDOWS 时间  QF解发段
        /// 例：  SENDMSGWINDOWS 300 @提示窗的触发
        /// 说明：300代表时间(秒)  @提示窗的触发 触发QFunction-0.txt
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        /// </summary>
        private void ActionOfSENDMSGWINDOWS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nTime;
            string sQFStr;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nTime = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);// 时间(秒)
                sQFStr = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);// 触发QFunction-0.txt段
                if ((sQFStr == "") || (nTime < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SENDMSGWINDOWS);
                    return;
                }
                PlayObject.m_dwUserTick[2] = (uint)nTime;// 设置人物的时间
                PlayObject.m_sMapQFStr1 = sQFStr;// SENDMSGWINDOWS命令设置的触发段
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSENDMSGWINDOWS");
            }
        }

        /// <summary>
        /// 时间到触发QF段
        /// 功能：关闭客户端'!'图标的显示
        /// 格式：CLOSEMSGWINDOWS
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCLOSEMSGWINDOWS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            PlayObject.SendMsg(PlayObject, Grobal2.RM_HIDESIGHICON, 0, 0, 0, 0, "");// 发消息给客户端关闭图标的显示
        }
        
        /// <summary>
        /// 关闭客户端'!'图标的显示
        /// 功能：取组队成员数
        /// 格式：GETGROUPCOUNT 变量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGETGROUPCOUNT(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGroupCount = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((PlayObject.m_GroupOwner != null)) // 有组队
                {
                    if (PlayObject.m_GroupOwner.m_GroupMembers.Count > 0)
                    {
                        nGroupCount = PlayObject.m_GroupOwner.m_GroupMembers.Count;
                    }
                }
                SetValValue(PlayObject, QuestActionInfo.sParam1, nGroupCount);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETGROUPCOUNT");
            }
        }

        /// <summary>
        /// 功能: 改变发型
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeHairStyle(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nHair;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nHair = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                if ((QuestActionInfo.sParam1 != "") && (nHair >= 0))
                {
                    PlayObject.m_btHair = (byte)nHair;
                    PlayObject.FeatureChanged();
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_HAIRSTYLE);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeHairStyle");
            }
        }

        /// <summary>
        /// 功能: 改变职业
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeJob(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nJob;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nJob = -1;
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "WARRIOR", 3))
                {
                    nJob = 0;
                }
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "WIZARD", 3))
                {
                    nJob = 1;
                }
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "TAOIST", 3))
                {
                    nJob = 2;
                }
                if (nJob < 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEJOB);
                    return;
                }
                if (PlayObject.m_btJob != nJob)
                {
                    PlayObject.m_btJob = (byte)nJob;
                    PlayObject.HasLevelUp(0);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeJob");
            }
        }

        /// <summary>
        /// 功能: 改变等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            bool boChgOK;
            int nLevel;
            int nLv;
            int nOldLevel;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                boChgOK = false;
                nOldLevel = PlayObject.m_Abil.Level;
                nLevel = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((nLevel < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLevel)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGELEVEL);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nLevel > 0) && (nLevel <= M2Share.MAXLEVEL))
                        {
                            PlayObject.m_Abil.Level = (ushort)nLevel;
                            PlayObject.HasLevelUp(1);
                            boChgOK = true;
                        }
                        break;
                    case '-':
                        nLv = HUtil32._MAX(0, PlayObject.m_Abil.Level - nLevel);
                        nLv = HUtil32._MIN(M2Share.MAXLEVEL, nLv);
                        PlayObject.m_Abil.Level = (ushort)nLv;
                        boChgOK = true;
                        break;
                    case '+':
                        nLv = HUtil32._MAX(0, PlayObject.m_Abil.Level + nLevel);
                        nLv = HUtil32._MIN(M2Share.MAXLEVEL, nLv);
                        PlayObject.m_Abil.Level = (ushort)nLv;
                        PlayObject.HasLevelUp(1);
                        boChgOK = true;
                        break;
                }
                if (boChgOK)
                {
                    PlayObject.HasLevelUp(nOldLevel);// 等级调整记录日志 20080911
                    M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString()
                        + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString() + "\09" + "0" + "\09" + cMethod + "(" + (nLevel).ToString() + ")"
                        + "\09" + this.m_sCharName);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeLevel");
            }
        }

        /// <summary>
        /// 功能: 调整PK值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangePkPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nPKPOINT;
            int nPoint;
            int nOldPKLevel;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldPKLevel = PlayObject.PKLevel();
                nPKPOINT = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nPKPOINT < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nPKPOINT)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEPKPOINT);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nPKPOINT >= 0))
                        {
                            PlayObject.m_nPkPoint = nPKPOINT;
                        }
                        break;
                    case '-':
                        nPoint = HUtil32._MAX(0, PlayObject.m_nPkPoint - nPKPOINT);
                        PlayObject.m_nPkPoint = nPoint;
                        break;
                    case '+':
                        nPoint = HUtil32._MAX(0, PlayObject.m_nPkPoint + nPKPOINT);
                        PlayObject.m_nPkPoint = nPoint;
                        break;
                }
                if (nOldPKLevel != PlayObject.PKLevel())
                {
                    PlayObject.RefNameColor();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangePkPoint");
            }
        }

        /// <summary>
        /// 功能: 清除地图怪物
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfClearMapMon(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            List<TBaseObject> MonList;
            TBaseObject mon;
            int II;
            string sMap;
            try
            {
                // ----------------------------------------------------------------------------------------
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                // ======================================================================
                MonList = new List<TBaseObject>();
                try
                {
                    sMap = QuestActionInfo.sParam1;
                    if ((sMap != "") && (sMap[0] == '<') && (sMap[1] == '$'))
                    {
                        sMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1); // 增加支持<$Str()>
                    }
                    else
                    {
                        GetValValue(PlayObject, QuestActionInfo.sParam1, ref sMap);
                    }
                    UserEngine.GetMapMonster(M2Share.g_MapManager.FindMap(sMap), MonList);
                    if (MonList.Count > 0)
                    {
                        for (II = 0; II < MonList.Count; II++)
                        {
                            mon = MonList[II];
                            if ((mon.m_Master != null) && (mon.m_btRaceServer != 135)) //135的宝宝也要清除
                            {
                                continue;
                            }
                            if (M2Share.GetNoClearMonList(mon.m_sCharName))
                            {
                                continue;
                            }
                            mon.m_boNoItem = true;
                            mon.m_Abil.HP = 0;
                            mon.MakeGhost();
                        }
                    }
                }
                finally
                {

                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearMapMon");
            }
        }

        /// <summary>
        /// 功能: 清空文件内容(并带创建文件)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfClearNameList(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TStringList LoadList;
            string sListFileName;
            string s01;
            // ----------------------------------------------------------------------------------------
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            // ======================================================================
            s01 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 路径支持变量
            if (s01[0] == '\\')
            {
                s01 = s01.Substring(2 - 1, s01.Length - 1);
            }
            if (s01[1] == '\\')
            {
                s01 = s01.Substring(3 - 1, s01.Length - 2);
            }
            if (s01[2] == '\\')
            {
                s01 = s01.Substring(4 - 1, s01.Length - 3);
            }
            sListFileName = M2Share.g_Config.sEnvirDir + s01;
            LoadList = new TStringList();
            try
            {
                LoadList.Clear();
                try
                {

                    LoadList.SaveToFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件保存失败 => " + sListFileName);
                }
            }
            finally
            {
            }
        }

        /// <summary>
        /// 功能：清除人物的所有技能。
        /// 格式：CLEARSKILL  (加参数HERO,即是删除英雄技能,空则是人物技能)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfClearSkill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserMagic* UserMagic;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CLEARSKILL);
                        return;
                    }
                    if (PlayObject.m_MyHero != null)
                    {
                        for (int I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                            {
                                break;
                            }
                            UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];// 学过酒气护体,则把相关变量初始化
                            if ((UserMagic->MagicInfo.wMagicId == 68) && ((((THeroObject)(PlayObject.m_MyHero)).m_MaxExp68 != 0) || (((THeroObject)(PlayObject.m_MyHero)).m_Exp68 != 0)))
                            {
                                ((THeroObject)(PlayObject.m_MyHero)).m_MaxExp68 = 0;
                                ((THeroObject)(PlayObject.m_MyHero)).m_Exp68 = 0;
                            }
                            PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                            ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                            UserMagic = null;
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                        PlayObject.m_MyHero.CompareSuitItem(false);//套装
                    }
                }
                else
                {
                    for (int I = PlayObject.m_MagicList.Count - 1; I >= 0; I--)
                    {
                        if (PlayObject.m_MagicList.Count <= 0)
                        {
                            break;
                        }
                        UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                        if ((UserMagic->MagicInfo.wMagicId == 68) && ((PlayObject.m_MaxExp68 != 0) || (PlayObject.m_Exp68 != 0))) // 是酒气护体
                        {
                            PlayObject.m_MaxExp68 = 0;
                            PlayObject.m_Exp68 = 0;
                        }
                        PlayObject.SendDelMagic(UserMagic);
                        UserMagic = null;
                        PlayObject.m_MagicList.RemoveAt(I);
                    }
                    PlayObject.RecalcAbilitys();
                    PlayObject.CompareSuitItem(false);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearSkill");
            }
        }

        /// <summary>
        /// 功能：清除人物非本职业的所有技能
        /// 格式：DELNOJOBSKILL    (加参数HERO,即是删除英雄技能,空则是人物技能)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfDelNoJobSkill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserMagic* UserMagic;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELNOJOBSKILL);
                        return;
                    }
                    if (PlayObject.m_MyHero != null)
                    {
                        for (int I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                            {
                                break;
                            }
                            UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                            if (UserMagic->MagicInfo.btJob != PlayObject.m_MyHero.m_btJob) // 学过酒气护体,则把相关变量初始化
                            {
                                if ((UserMagic->MagicInfo.wMagicId == 68) && ((((THeroObject)(PlayObject.m_MyHero)).m_MaxExp68 != 0) || (((THeroObject)(PlayObject.m_MyHero)).m_Exp68 != 0)))
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).m_MaxExp68 = 0;
                                    ((THeroObject)(PlayObject.m_MyHero)).m_Exp68 = 0;
                                }
                                PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                                ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                                //Dispose(UserMagic);
                                UserMagic = null;
                            }
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                        PlayObject.m_MyHero.CompareSuitItem(false);// 套装
                    }
                }
                else
                {
                    for (int I = PlayObject.m_MagicList.Count - 1; I >= 0; I--)
                    {
                        if (PlayObject.m_MagicList.Count <= 0)
                        {
                            break;
                        }
                        UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                        if (UserMagic->MagicInfo.btJob != PlayObject.m_btJob)
                        {
                            if ((UserMagic->MagicInfo.wMagicId == 68) && ((PlayObject.m_MaxExp68 != 0) || (PlayObject.m_Exp68 != 0))) // 是酒气护体
                            {
                                PlayObject.m_MaxExp68 = 0;
                                PlayObject.m_Exp68 = 0;
                            }
                            PlayObject.SendDelMagic(UserMagic);
                            //Dispose(UserMagic);
                            UserMagic = null;
                            PlayObject.m_MagicList.RemoveAt(I);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDelNoJobSkill");
            }
        }

        /// <summary>
        /// 功能：删除技能
        /// 格式：DELSKILL 技能名称 HERO  (加参数HERO,即是删除英雄技能)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfDelSkill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int I;
            string sMagicName;
            TMagic* Magic;
            TUserMagic* UserMagic;
            try
            {
                // ----------------------------------------------------------------------------------------
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                // ======================================================================
                sMagicName = QuestActionInfo.sParam1;
                if ((QuestActionInfo.sParam2).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELSKILL);
                        return;
                    }
                    Magic = UserEngine.FindHeroMagic(sMagicName);
                    if (Magic == null)
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELSKILL);
                        return;
                    }
                    if (PlayObject.m_MyHero != null)
                    {
                        for (I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                            {
                                break;
                            }
                            UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                            if (&UserMagic->MagicInfo == Magic)
                            {
                                PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                                ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                                Marshal.FreeHGlobal((IntPtr)UserMagic);
                                break;
                            }
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                        PlayObject.m_MyHero.CompareSuitItem(false);// 套装
                    }
                }
                else
                {
                    Magic = UserEngine.FindMagic(sMagicName);
                    if (Magic == null)
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DELSKILL);
                        return;
                    }
                    for (I = PlayObject.m_MagicList.Count - 1; I >= 0; I--)
                    {
                        if (PlayObject.m_MagicList.Count <= 0)
                        {
                            break;
                        }
                        UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                        if (&UserMagic->MagicInfo == Magic)
                        {
                            PlayObject.m_MagicList.RemoveAt(I);
                            PlayObject.SendDelMagic(UserMagic);
                            Marshal.FreeHGlobal((IntPtr)UserMagic);
                            break;
                        }
                    }
                    PlayObject.RecalcAbilitys();
                    PlayObject.CompareSuitItem(false);//套装
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDelSkill");
            }
        }

        /// <summary>
        /// 功能：调整游戏币(元宝)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGameGold(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGameGold;
            int nOldGameGold;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldGameGold = PlayObject.m_nGameGold;
                nGameGold = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nGameGold < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nGameGold)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GAMEGOLD);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nGameGold >= 0))
                        {
                            PlayObject.m_nGameGold = nGameGold;
                        }
                        break;
                    case '-':
                        PlayObject.m_nGameGold = HUtil32._MAX(0, PlayObject.m_nGameGold - nGameGold);
                        break;
                    case '+':
                        PlayObject.m_nGameGold = HUtil32._MIN(Int32.MaxValue, PlayObject.m_nGameGold + nGameGold);
                        break;
                }
                if (M2Share.g_boGameLogGameGold)
                {
                    M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GAMEGOLD, PlayObject.m_sMapName, PlayObject.m_nCurrX,
                        PlayObject.m_nCurrY, PlayObject.m_sCharName, M2Share.g_Config.sGameGoldName, PlayObject.m_nGameGold, cMethod + "(" + (nGameGold).ToString() + ")",
                        this.m_sCharName));
                }
                if (nOldGameGold != PlayObject.m_nGameGold)
                {
                    PlayObject.GameGoldChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGameGold");
            }
        }

        /// <summary>
        /// 功能：调整金刚石动作
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGameDiaMond(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGameDiaMond;
            int nOldGameDiaMond;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldGameDiaMond = PlayObject.m_nGAMEDIAMOND;
                nGameDiaMond = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nGameDiaMond < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nGameDiaMond)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GAMEDIAMOND);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nGameDiaMond >= 0))
                        {
                            PlayObject.m_nGAMEDIAMOND = nGameDiaMond;
                        }
                        break;
                    case '-':
                        PlayObject.m_nGAMEDIAMOND = HUtil32._MAX(0, PlayObject.m_nGAMEDIAMOND - nGameDiaMond);
                        break;
                    case '+':
                        PlayObject.m_nGAMEDIAMOND = HUtil32._MIN(Int32.MaxValue, PlayObject.m_nGAMEDIAMOND + nGameDiaMond);
                        break;
                }
                if (M2Share.g_boGameLogGameDiaMond)
                {
                    M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GameDiaMond, PlayObject.m_sMapName,
                        PlayObject.m_nCurrX, PlayObject.m_nCurrY, PlayObject.m_sCharName, M2Share.g_Config.sGameDiaMond, PlayObject.m_nGAMEDIAMOND, 
                        cMethod + "(" + (nGameDiaMond).ToString() + ")", this.m_sCharName));
                }
                if (nOldGameDiaMond != PlayObject.m_nGAMEDIAMOND)
                {
                    PlayObject.GameGoldChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGameDiaMond");
            }
        }

        /// <summary>
        /// 功能：调整灵符动作
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGameGird(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGameGird;
            int nOldGameGird;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldGameGird = PlayObject.m_nGAMEGIRD;
                nGameGird = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nGameGird < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nGameGird)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GAMEGIRD);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nGameGird >= 0))
                        {
                            PlayObject.m_nGAMEGIRD = nGameGird;
                        }
                        break;
                    case '-':
                        PlayObject.m_nGAMEGIRD = HUtil32._MAX(0, PlayObject.m_nGAMEGIRD - nGameGird);
                        PlayObject.m_UseGameGird = nGameGird;// 灵符使用计数
                        if (M2Share.g_FunctionNPC != null)
                        {
                            M2Share.g_FunctionNPC.GotoLable(PlayObject, "@USEGAMEGIRD", false); // 灵符使用触发
                        }
                        break;
                    case '+':
                        PlayObject.m_nGAMEGIRD = HUtil32._MIN(Int32.MaxValue, PlayObject.m_nGAMEGIRD + nGameGird);
                        break;
                }
                if (M2Share.g_boGameLogGameGird)
                {
                    M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GameGird, PlayObject.m_sMapName,
                        PlayObject.m_nCurrX, PlayObject.m_nCurrY, PlayObject.m_sCharName, M2Share.g_Config.sGameGird, PlayObject.m_nGAMEGIRD, cMethod 
                        + "(" + (nGameGird).ToString() + ")", this.m_sCharName));
                }
                if (nOldGameGird != PlayObject.m_nGAMEGIRD)
                {
                    PlayObject.GameGoldChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGameGird");
            }
        }
    
        /// <summary>
        /// 功能：调整英雄技能升级点数 
        /// 格式: ChangeHeroTranPoint 技能名 操作符(+ - =) 数值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfCHANGEHEROTRANPOINT(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nTranPoint;
            int nOldTranPoint;
            string sMagicName;
            string cMethod;
            TUserMagic* UserMagic;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_MyHero == null)
                {
                    return;
                }
                sMagicName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                nTranPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                if ((nTranPoint < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam3, ref nTranPoint)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROTRANPOINT);
                    return;
                }
                cMethod = QuestActionInfo.sParam2[0].ToString();
                if ((sMagicName == "") && (cMethod == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROTRANPOINT);
                    return;
                }
                UserMagic = ((TPlayObject)(PlayObject.m_MyHero)).GetMagicInfo(sMagicName);
                if (UserMagic != null)
                {
                    nOldTranPoint = UserMagic->nTranPoint;
                    switch (cMethod)
                    {
                        case "=":
                            if ((nTranPoint >= 0))
                            {
                                UserMagic->nTranPoint = nTranPoint;
                            }
                            break;
                        case "-":
                            nTranPoint = HUtil32._MAX(0, UserMagic->nTranPoint - nTranPoint);
                            if (nTranPoint < 0)
                            {
                                nTranPoint = 0;
                            }
                            UserMagic->nTranPoint = nTranPoint;
                            break;
                        case "+":
                            if ((UserMagic->btLevel < 3) && (UserMagic->MagicInfo.TrainLevel[UserMagic->btLevel] <= PlayObject.m_MyHero.m_Abil.Level))
                            {
                                nTranPoint = HUtil32._MAX(0, UserMagic->nTranPoint + nTranPoint);
                                UserMagic->nTranPoint = nTranPoint;
                            }
                            break;
                    }
                    if (nOldTranPoint != UserMagic->nTranPoint)
                    {
                        if (!((THeroObject)(PlayObject.m_MyHero)).CheckMagicLevelup(UserMagic))
                        {
                            ((THeroObject)(PlayObject.m_MyHero)).SendDelayMsg(PlayObject.m_MyHero, Grobal2.RM_HEROMAGIC_LVEXP, 0, UserMagic->MagicInfo.wMagicId, UserMagic->btLevel, UserMagic->nTranPoint, "", 500);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGEHEROTRANPOINT");
            }
        }
    
        /// <summary>
        /// 功能：寄放英雄 
        /// 英雄必须要在线,成功后,英雄退出,再召唤英雄,没有提示
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfSAVEHERO(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))//玩家没有英雄
                {
                    if (PlayObject.m_boPlayDrink)
                    {
                        GotoLable(PlayObject, "~PlayDrink_Already_NotHero", false);
                    }
                    else
                    {
                        return;
                    }
                }
                if (PlayObject.m_MyHero != null) // 英雄在线,才能进寄放
                {
                    if (((THeroObject)(PlayObject.m_MyHero)).m_btMentHero == 1)
                    {
                        GotoLable(PlayObject, "@NoSaveHero2", false);
                        return;
                    }
                    if (((THeroObject)(PlayObject.m_MyHero)).m_btMentHero == 2)
                    {
                        GotoLable(PlayObject, "@NoSaveHero3", false);
                        return;
                    }
                    PlayObject.m_sHeroCharName = "";// 将主人的英雄名清空,达到不能召唤英雄的目的
                    PlayObject.n_HeroSave = 1;// 寄放英雄标识
                    PlayObject.ClientHeroLogOut(1);// 英雄退出,没有提示
                    GotoLable(PlayObject, "~PlayDrink_HeroOk", false);
                }
                else
                {
                    if (PlayObject.m_boPlayDrink)  // 英雄不在线
                    {
                        GotoLable(PlayObject, "~PlayDrink_Already_HeroBegin", false);
                    }
                    else
                    {
                        GotoLable(PlayObject, "~PlayDrink_HeroBegin", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSAVEHERO");
            }
        }

        /// <summary>
        /// 功能：取回英雄
        /// 有两个英雄时,需全寄放后,才能取回一个英雄
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGETHERO(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((PlayObject.m_sHeroCharName == "") && (PlayObject.m_boHasHero || PlayObject.m_boHasHeroTwo))// 身上没有英雄才能取回
                {
                    // 发消息,显示取回英雄的窗口,选择后,改变主人变量,
                    M2Share.FrontEngine.AddToLoadHeroRcdList(PlayObject.m_sCharName, "", PlayObject, 3);
                }
                else
                {
                    if (M2Share.g_FunctionNPC != null)
                    {
                        M2Share.g_FunctionNPC.GotoLable(PlayObject, "@GetHeroBak", false);//没有存放英雄
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETHERO");
            }
        }

        /// <summary>
        /// 功能：关闭斗酒,请酒窗口 
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCLOSEDRINK(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.SendMsg(this, Grobal2.RM_CLOSEDRINK, 0, 0, 0, 0, "");
                PlayObject.n_DrinkValue[0] = 0;// 喝酒的醉酒值 0-NPC 1-玩家
                PlayObject.n_DrinkValue[1] = 0;
                PlayObject.n_DrinkCount = 0;// 喝酒的次数(斗酒一次最高6次)
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCLOSEDRINK");
            }
        }

        /// <summary>
        /// 关闭斗酒窗口
        /// 斗酒窗口说话信息
        /// 格式:PLAYDRINKMSG 类型 说话信息
        /// (设置请酒显示内容) PLAYDRINKMSG 消息位置(1[上面],2[下面]) 消息内容(跟#say一样)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfPLAYDRINKMSG(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nDisplay;// 消息显示的位置
            string sMsg;// 消息内容
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nDisplay = (byte)HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                sMsg = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);
                if ((!new ArrayList(new int[] { 1, 2 }).Contains(nDisplay)) || (sMsg == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_PLAYDRINKMSG);
                    return;
                }
                PlayObject.SendMsg(this, Grobal2.RM_PLAYDRINKSAY, 0, 0, 0, nDisplay, sMsg);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfPLAYDRINKMSG");
            }
        }

        /// <summary>
        /// 打开酒界面 
        /// 格式:OPENPLAYDRINK 人物头像(0,1,2) 人物名字(0:翔天,1:辰星,2:影月)  DRINK----(打开斗酒界面)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfOPENPLAYDRINK(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nIcon;// 人物头像
            string sName = string.Empty;// 人物名称
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nIcon = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                sName = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);
                if (nIcon < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nIcon);
                }
                if ((nIcon < 0) || (nIcon > 3) || (sName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_OPENPLAYDRINK);
                    return;
                }
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("DRINK").ToLower()) == 0)  
                {
                    PlayObject.SendMsg(this, Grobal2.RM_OPENPLAYDRINK, 0, 0, 1, nIcon, sName);// 打开斗酒界面
                    PlayObject.n_DrinkValue[0] = 0;// 喝酒的醉酒值 0-NPC 1-玩家
                    PlayObject.n_DrinkValue[1] = 0;
                    PlayObject.n_DrinkCount = 0;// 喝酒的次数(斗酒一次最高6次)
                }
                else
                {
                    if (PlayObject.m_boPlayDrink)// 打开请酒界面
                    {
                        // 已请过酒的直接操作
                        GotoLable(PlayObject, "@SaveHero", false);
                    }
                    else
                    {
                        // 没请过酒的,打开请酒界面
                        PlayObject.SendMsg(this, Grobal2.RM_OPENPLAYDRINK, 0, 0, 2, nIcon, sName);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENPLAYDRINK");
            }
        }

        /// <summary>
        /// 功能：调整人物属性
        /// 格式：CHANGEHUMABILITY 属性(0-8) 操作符(=/-/+) 属性值(1-65535) 时间(秒)
        /// 注意:调整后的属性效果只在人物在线时有效
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHANGEHUMABILITY(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nValue;
            char cMethod;
            int nTime;
            ushort nValeu1;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nValue = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);
                nValeu1 = (ushort)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);
                nTime = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam4), 0);
                if ((nValue > 9) || (nValue < 0) || (nValeu1 == 0) || (nTime == 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHUMABILITY);
                    return;
                }
                cMethod = QuestActionInfo.sParam2[1];
                switch (cMethod)
                {
                    case '=':
                        PlayObject.m_wStatusArrValue[nValue] = nValeu1;

                        PlayObject.m_dwStatusArrTimeOutTick[nValue] = Convert.ToByte(HUtil32.GetTickCount() + nTime * 1000);
                        break;
                    case '-':
                        PlayObject.m_wStatusArrValue[nValue] = Convert.ToByte(HUtil32._MAX(0, PlayObject.m_wStatusArrValue[nValue] - nValeu1));

                        PlayObject.m_dwStatusArrTimeOutTick[nValue] = Convert.ToByte(HUtil32.GetTickCount() + nTime * 1000);
                        break;
                    case '+':
                        PlayObject.m_wStatusArrValue[nValue] = Convert.ToByte(PlayObject.m_wStatusArrValue[nValue] + nValeu1);
                        PlayObject.m_dwStatusArrTimeOutTick[nValue] = Convert.ToByte(HUtil32.GetTickCount() + nTime * 1000);
                        break;
                }
                if (PlayObject.m_btRaceServer == Grobal2.RC_HEROOBJECT)
                {
                    //((THeroObject)(PlayObject)).RecalcAbilitys();
                    PlayObject.CompareSuitItem(false);// 套装
                    //((THeroObject)(PlayObject)).SendMsg(PlayObject, Grobal2.RM_HEROABILITY, 0, 0, 0, 0, "");// 发送英雄属性 
                }
                else
                {
                    PlayObject.RecalcAbilitys();
                    PlayObject.CompareSuitItem(false);// 套装
                    PlayObject.SendMsg(PlayObject, Grobal2.RM_ABILITY, 0, 0, 0, 0, "");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGEHUMABILITY");
            }
        }

        /// <summary>
        /// 功能：调整英雄的忠诚度
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfHeroLoyal(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nLoyal;
            int nOldLoyal;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_MyHero == null)
                {
                    return;
                }
                nOldLoyal = ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal;
                nLoyal = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((nLoyal < 0) && (nLoyal > 10000) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLoyal)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROLOYAL);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nLoyal >= 0))
                        {
                            ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal = nLoyal;
                        }
                        break;
                    case '-':
                        nLoyal = HUtil32._MAX(0, ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal - nLoyal);
                        if (nLoyal < 0)
                        {
                            nLoyal = 0;
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal = nLoyal;
                        break;
                    case '+':
                        nLoyal = HUtil32._MAX(0, ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal + nLoyal);
                        if (nLoyal > 10000)
                        {
                            nLoyal = 10000; // 修正NPC加忠诚度超过最大值
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal = nLoyal;
                        break;
                }
                if (nOldLoyal != ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal)
                {
                    PlayObject.GameGoldChanged();
                    //this.m_DefMsg = EDcode.Units.EDcode.MakeDefaultMsg(Grobal2.SM_HEROABILITY, ((THeroObject)(PlayObject.m_MyHero)).m_btGender, 0, ((THeroObject)(PlayObject.m_MyHero)).m_btJob, ((THeroObject)(PlayObject.m_MyHero)).m_nLoyal, 0);
                    //((THeroObject)(PlayObject.m_MyHero)).SendSocket(this.m_DefMsg, EDcode.Units.EDcode.EncodeBuffer(((THeroObject)(PlayObject.m_MyHero)).m_WAbil, sizeof(TAbility)));
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfHeroLoyal");
            }
        }

        /// <summary>
        /// 功能:调整泡点
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGamePoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGamePoint;
            int nOldGamePoint;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nOldGamePoint = PlayObject.m_nGamePoint;
                nGamePoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if ((nGamePoint < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nGamePoint)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GAMEPOINT);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if ((nGamePoint >= 0))
                        {
                            PlayObject.m_nGamePoint = (UInt16)nGamePoint;
                        }
                        break;
                    case '-':
                        nGamePoint = HUtil32._MAX(0, PlayObject.m_nGamePoint - nGamePoint);
                        PlayObject.m_nGamePoint = (UInt16)nGamePoint;
                        break;
                    case '+':
                        nGamePoint = HUtil32._MAX(0, PlayObject.m_nGamePoint + nGamePoint);
                        PlayObject.m_nGamePoint = (UInt16)nGamePoint;
                        break;
                }
                if (M2Share.g_boGameLogGamePoint)
                {
                    M2Share.AddGameDataLog(string.Format(GameMsgDef.g_sGameLogMsg1, M2Share.LOG_GAMEPOINT, PlayObject.m_sMapName, PlayObject.m_nCurrX, 
                        PlayObject.m_nCurrY, PlayObject.m_sCharName, M2Share.g_Config.sGamePointName, PlayObject.m_nGamePoint, cMethod + "(" 
                        + (nGamePoint).ToString() + ")", this.m_sCharName));
                }
                if (nOldGamePoint != PlayObject.m_nGamePoint)
                {
                    PlayObject.GameGoldChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGamePoint");
            }
        }

        private void ActionOfGetMarry(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject PoseBaseObject;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PoseBaseObject = PlayObject.GetPoseCreate();
                if ((PoseBaseObject != null) && (PoseBaseObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT) && (PoseBaseObject.m_btGender != PlayObject.m_btGender))
                {
                    PlayObject.m_sDearName = PoseBaseObject.m_sCharName;
                    PlayObject.RefShowName();
                    PoseBaseObject.RefShowName();
                }
                else
                {
                    GotoLable(PlayObject, "@MarryError", false);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGetMarry");
            }
        }

        private void ActionOfGetMaster(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject PoseBaseObject;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PoseBaseObject = PlayObject.GetPoseCreate();
                if ((PoseBaseObject != null) && (PoseBaseObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT) && (PoseBaseObject.m_btGender != PlayObject.m_btGender))
                {
                    PlayObject.m_sMasterName = PoseBaseObject.m_sCharName;
                    PlayObject.RefShowName();
                    PoseBaseObject.RefShowName();
                }
                else
                {
                    GotoLable(PlayObject, "@MasterError", false);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGetMaster");
            }
        }

        /// <summary>
        /// 功能：利用NPC发送信息
        /// 格式: SENDMSG 信息类型代码 %s信息内容%d 字体颜色(0-255) 背景颜色(0-255)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfLineMsg(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMsg;
            string sParam2 = string.Empty;
            byte FColor = 0;
            byte BColor = 0;
            bool boIsCustom;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                boIsCustom = false;
                sParam2 = QuestActionInfo.sParam2;
                if ((QuestActionInfo.sParam3 != "") && (QuestActionInfo.sParam4 != ""))  // 如设置了自定义颜色时
                {
                    FColor = (byte)HUtil32._MIN(255, HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0));
                    BColor = (byte)HUtil32._MIN(255, HUtil32.Str_ToInt(QuestActionInfo.sParam4, 0));
                    boIsCustom = true;
                }
                GetValValue(PlayObject, QuestActionInfo.sParam2, ref sParam2);
                sMsg = GetLineVariableText(PlayObject, sParam2);
                sMsg = sMsg.Replace("%s", PlayObject.m_sCharName);
                sMsg = sMsg.Replace("%x", (PlayObject.m_nCurrX).ToString());
                sMsg = sMsg.Replace("%y", (PlayObject.m_nCurrY).ToString());
                if (PlayObject.m_PEnvir != null)
                {
                    sMsg = sMsg.Replace("%m", PlayObject.m_PEnvir.sMapDesc);
                }
                else
                {
                    sMsg = sMsg.Replace("%m", "????");
                }
                sMsg = sMsg.Replace("%d", this.m_sCharName);
                switch (QuestActionInfo.nParam1)
                {
                    case 0:
                        if (!boIsCustom)
                        {
                            UserEngine.SendBroadCastMsg(sMsg, TMsgType.t_System);
                        }
                        else
                        {
                            UserEngine.SendBroadCastMsg1(sMsg, TMsgType.t_System, FColor, BColor);
                        }
                        break;
                    case 1:// 0
                        if (!boIsCustom)
                        {
                            // 发送普通红色广播信息
                            UserEngine.SendBroadCastMsg("(*) " + sMsg, TMsgType.t_System);
                        }
                        else
                        {
                            UserEngine.SendBroadCastMsg1("(*) " + sMsg, TMsgType.t_System, FColor, BColor);
                        }
                        break;
                    case 2:// 1
                        if (!boIsCustom)
                        {
                            // 发送普通红色广播信息，并显示NPC名称
                            UserEngine.SendBroadCastMsg("[" + this.m_sCharName + "]" + sMsg, TMsgType.t_System);
                        }
                        else
                        {
                            UserEngine.SendBroadCastMsg1("[" + this.m_sCharName + "]" + sMsg, TMsgType.t_System, FColor, BColor);
                        }
                        break;
                    case 3:// 2
                        if (!boIsCustom)
                        {
                            // 发送普通红色广播信息，并人物NPC名称
                            UserEngine.SendBroadCastMsg("[" + PlayObject.m_sCharName + "]" + sMsg, TMsgType.t_System);
                        }
                        else
                        {
                            UserEngine.SendBroadCastMsg1("[" + PlayObject.m_sCharName + "]" + sMsg, TMsgType.t_System, FColor, BColor);
                        }
                        break;
                    case 4:// 3
                        if (!boIsCustom)// 在NPC头顶，显示普通说话信息
                        {
                            this.ProcessSayMsg(sMsg);
                        }
                        else
                        {
                            this.ProcessExtendSayMsg(sMsg, FColor, BColor);
                        }
                        break;
                    case 5:
                        if (!boIsCustom)// 发送红色信息给人物
                        {
                            PlayObject.SysMsg(sMsg, TMsgColor.c_Red, TMsgType.t_Say);
                        }
                        else
                        {
                            PlayObject.SysMsg1(sMsg, TMsgColor.c_Red, TMsgType.t_Say, FColor, BColor);
                        }
                        break;
                    case 6:
                        if (!boIsCustom)// 发送绿色信息给人物
                        {
                            PlayObject.SysMsg(sMsg, TMsgColor.c_Green, TMsgType.t_Say);
                        }
                        else
                        {
                            PlayObject.SysMsg1(sMsg, TMsgColor.c_Green, TMsgType.t_Say, FColor, BColor);
                        }
                        break;
                    case 7:
                        if (!boIsCustom)// 发送蓝色信息给人物
                        {
                            PlayObject.SysMsg(sMsg, TMsgColor.c_Blue, TMsgType.t_Say);
                        }
                        else
                        {
                            PlayObject.SysMsg1(sMsg, TMsgColor.c_Blue, TMsgType.t_Say, FColor, BColor);
                        }
                        break;
                    case 8:
                        if (PlayObject.m_MyGuild != null)
                        {
                            if (!boIsCustom)  // 发送行会信息
                            {
                                PlayObject.m_MyGuild.SendGuildMsg(sMsg);
                            }
                            else
                            {
                                PlayObject.m_MyGuild.SendGuildMsg1(sMsg, FColor, BColor);
                            }
                        }
                        break;
                    default:
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSENDMSG);
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfLineMsg");
            }
        }

        /// <summary>
        /// 功能：创建文本文件
        /// 格式：CreateFile QuestDiary\NewFile.txt
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCreateFile(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sFileName;
            TStringList SaveList;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            sFileName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 文本路径
            if (sFileName[0] == '\\')
            {
                sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
            }
            if (sFileName[1] == '\\')
            {
                sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
            }
            if (sFileName[2] == '\\')
            {
                sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
            }
            sFileName = M2Share.g_Config.sEnvirDir + sFileName;
            SaveList = new TStringList();
            try
            {
                if (!File.Exists(sFileName))
                {
                    try
                    {
                        SaveList.SaveToFile(sFileName);
                    }
                    catch
                    {
                        M2Share.MainOutMessage("文件保存失败 => " + sFileName);
                    }
                }
            }
            finally
            {
                Dispose(SaveList);
            }
        }

        /// <summary>
        /// 功能：顶端滚动公告
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfSendTopMsg(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMsg;
            string sParam3 = string.Empty;
            int FColor;
            int BColor;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                FColor = QuestActionInfo.nParam1;
                BColor = QuestActionInfo.nParam2;
                sParam3 = QuestActionInfo.sParam3;
                GetValValue(PlayObject, QuestActionInfo.sParam3, ref sParam3);// 消息文字
                sMsg = GetLineVariableText(PlayObject, sParam3);// 0为滚动
                PlayObject.SendRefMsg(Grobal2.RM_MOVEMESSAGE, 0, FColor, BColor, 0, sMsg);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSendTopMsg");
            }
        }

        /// <summary>
        /// 顶端滚动公告
        /// 功能：屏幕居中显示公告 
        /// 格式：SendCenterMsg 前景色 背景色 消息文字 模式 显示时间(秒)
        /// 模式 0发给自己 1发送所有人 2发送行会 3发送当前地图
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfSendCenterMsg(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMsg;
            string sParam3 = string.Empty;
            int FColor;
            int BColor;
            int nTime;
            int nMode;
            TPlayObject BaseObject;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMode = -1;
                FColor = QuestActionInfo.nParam1;// 前景色
                BColor = QuestActionInfo.nParam2;// 背景色
                if (QuestActionInfo.sParam4 != "")
                {
                    nMode = HUtil32.Str_ToInt(QuestActionInfo.sParam4, -1); // 模式
                }
                nTime = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam5), 0);// 时间
                sParam3 = QuestActionInfo.sParam3;// 消息文字
                GetValValue(PlayObject, QuestActionInfo.sParam3, ref sParam3);
                sMsg = GetLineVariableText(PlayObject, sParam3);
                switch (nMode)
                {
                    case 0:
                        PlayObject.SendMsg(PlayObject, Grobal2.RM_MOVEMESSAGE, 1, FColor, BColor, nTime, sMsg);
                        break;
                    case 1:// 发给自已
                        if (UserEngine.m_PlayObjectList.Count > 0)
                        {
                            for (int I = 0; I < UserEngine.m_PlayObjectList.Count; I++)
                            {
                                BaseObject = UserEngine.m_PlayObjectList[I];
                                if (BaseObject != null)
                                {
                                    if (!BaseObject.m_boGhost)
                                    {
                                        BaseObject.SendMsg(PlayObject, Grobal2.RM_MOVEMESSAGE, 1, FColor, BColor, nTime, sMsg);
                                    }
                                }
                            }
                        }
                        break;
                    case 2:// 发送行会
                        if (PlayObject.m_MyGuild != null)
                        {
                            if (UserEngine.m_PlayObjectList.Count > 0)
                            {
                                for (int I = 0; I < UserEngine.m_PlayObjectList.Count; I++)
                                {
                                    BaseObject = UserEngine.m_PlayObjectList[I];
                                    if (BaseObject != null)
                                    {
                                        if (!BaseObject.m_boDeath && !BaseObject.m_boGhost && PlayObject.m_MyGuild.IsMember(BaseObject.m_sCharName))
                                        {
                                            BaseObject.SendMsg(PlayObject, Grobal2.RM_MOVEMESSAGE, 1, FColor, BColor, nTime, sMsg);
                                        }
                                    }
                                }
                            }
                        }
                        break;
                    case 3:// 当前地图
                        if (UserEngine.m_PlayObjectList.Count > 0)
                        {
                            for (int I = 0; I < UserEngine.m_PlayObjectList.Count; I++)
                            {
                                BaseObject = UserEngine.m_PlayObjectList[I];
                                if (BaseObject != null)
                                {
                                    if (!BaseObject.m_boDeath && !BaseObject.m_boGhost && (BaseObject.m_PEnvir == PlayObject.m_PEnvir))
                                    {
                                        BaseObject.SendMsg(PlayObject, Grobal2.RM_MOVEMESSAGE, 1, FColor, BColor, nTime, sMsg);
                                    }
                                }
                            }
                        }
                        break;
                    default:
                        PlayObject.SendRefMsg(Grobal2.RM_MOVEMESSAGE, 1, FColor, BColor, nTime, sMsg);
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSendCenterMsg");
            }
        }

        /// <summary>
        /// 聊天框顶端公告
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfSendEditTopMsg(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMsg;
            string sParam3 = string.Empty;
            int FColor;
            int BColor;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                FColor = QuestActionInfo.nParam1;
                BColor = QuestActionInfo.nParam2;
                sParam3 = QuestActionInfo.sParam3;
                GetValValue(PlayObject, QuestActionInfo.sParam3, ref sParam3);
                sMsg = GetLineVariableText(PlayObject, sParam3);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSendEditTopMsg");
            }
        }
        
        /// <summary>
        ///  功能:打开酿酒窗口 
        ///  格式:OPENMAKEWINE X(0,1) 0-酿造普通酒 1-酿造药酒
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfOPENMAKEWINE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nCode = 0;
            TUserItem* UserItem;
            TStdItem* StdItem;
            bool boIsCanOpenMakeWine;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((this) as TMerchant).m_boPlayMakeWine)// 酿酒NPC标识
                {
                    nCode = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 2);// 打开窗口标识
                    if (!new ArrayList(new int[] { 0, 1 }).Contains(nCode))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sOPENMAKEWINE);
                        return;
                    }
                    boIsCanOpenMakeWine = false;// 是否可以酿酒
                    if (PlayObject.m_ItemList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_ItemList.Count; I++)
                        {
                            UserItem = (TUserItem*)PlayObject.m_ItemList[I]; // 判断玩家包裹是否有酒器,有则可进行,没有则返回
                            StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                            if ((StdItem != null) && (StdItem->StdMode == 12)) // 有酒器
                            {
                                boIsCanOpenMakeWine = true;
                                break;
                            }
                        }
                    }
                    if (boIsCanOpenMakeWine)
                    {
                        PlayObject.SendMsg(this, Grobal2.RM_OPENMAKEWINE, 0, nCode, 0, 0, this.m_sCharName);
                    }
                    else
                    {
                        GotoLable(PlayObject, "@NoCanMakeWine", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENMAKEWINE");
            }
        }

        /// <summary>
        /// 功能:取回酿好的酒
        /// 格式:GETGOODMAKEWINE
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfGETGOODMAKEWINE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserItem* UserItem = null;
            TUserItem* UserItem1 = null;
            TStdItem* StdItem;
            TStdItem* StdItem1;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            PlayObject.bo_NPCMove = false;// 是否点击,让NPC走动
            try
            {
                if (((this) as TMerchant).m_boPlayMakeWine) // 酿酒NPC标识
                {
                    if (PlayObject.m_boMakeWine)// 在NPC处正在酿酒
                    {
                        // 判断酿酒时间是否到,如果到时间则给玩家对应的酒,并且的种类为0时
                        if ((PlayObject.m_MakeWineTime == 0) && (PlayObject.n_MakeWineItmeType != 0))
                        {
                            StdItem = UserEngine.GetMakeWineStdItem(PlayObject.n_MakeWineItmeType);
                            if ((StdItem != null) && (StdItem->AniCount == PlayObject.n_MakeWineType))
                            {
                                UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                if (UserEngine.CopyToUserItemFromName(HUtil32.SBytePtrToString(StdItem->Name, 0, StdItem->NameLen), UserItem))
                                {
                                    PlayObject.m_boMakeWine = false;// 改变标识,不管包裹满否
                                    if (PlayObject.IsEnoughBag() && PlayObject.IsAddWeightAvailable(StdItem->Weight))
                                    {
                                        // 包裹有位置则放到包裹里,没有则扔出物品
                                        // 改变品质及酒精度
                                        UserItem->btValue[0] = (byte)PlayObject.n_MakeWineQuality;// 酒的品质
                                        UserItem->btValue[1] = (byte)PlayObject.n_MakeWineAlcohol;// 酒精度
                                        if (PlayObject.n_MakeWineType == 2) // 药酒,有药力值
                                        {
                                            UserItem->btValue[2] = (byte)HUtil32._MAX(1, PlayObject.n_MakeWineQuality - 5);// 药酒至少可以增加1点药力值 20081210
                                        }
                                        if (StdItem->NeedIdentify == 1)
                                        {
                                            M2Share.AddGameDataLog("38" + "\09" + this.m_sMapName + "\09" + (this.m_nCurrX).ToString() + "\09" + (this.m_nCurrY).ToString()
                                                + "\09" + PlayObject.m_sCharName + "\09" + HUtil32.SBytePtrToString(StdItem->Name, 0, StdItem->NameLen) + "\09" + (UserItem->MakeIndex).ToString() + "\09" + (UserItem->btValue[0]).ToString()
                                                + "/" + (UserItem->btValue[1]).ToString() + "\09" + this.m_sCharName);
                                        }
                                        PlayObject.m_ItemList.Add((IntPtr)UserItem);
                                        if (PlayObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT)
                                        {
                                            PlayObject.SendAddItem(UserItem);
                                            PlayObject.SendUpdateItem(UserItem);// 更新物品
                                        }
                                        if ((HUtil32.Random(M2Share.g_Config.nMakeWineRate) == 0) && (PlayObject.n_MakeWineType == 1))   // 一定机率获得酒曲
                                        {
                                            StdItem1 = UserEngine.GetMakeWineStdItem1(StdItem->Shape);// 通过酒的Shape得到酒曲
                                            if (StdItem1 != null)
                                            {
                                                UserItem1 = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                                if (UserEngine.CopyToUserItemFromName(HUtil32.SBytePtrToString(StdItem1->Name, 0, StdItem1->NameLen), UserItem1))
                                                {
                                                    if (PlayObject.IsEnoughBag() && PlayObject.IsAddWeightAvailable(StdItem1->Weight))
                                                    {
                                                        if (StdItem1->NeedIdentify == 1)
                                                        {
                                                            M2Share.AddGameDataLog("38" + "\09" + this.m_sMapName + "\09" + (this.m_nCurrX).ToString() + "\09" + (this.m_nCurrY).ToString()
                                                                + "\09" + PlayObject.m_sCharName + "\09" + HUtil32.SBytePtrToString(StdItem1->Name, 0, StdItem1->NameLen) + "\09" + (UserItem1->MakeIndex).ToString() + "\09" + "1" + "\09"
                                                                + this.m_sCharName);
                                                        }
                                                        PlayObject.m_ItemList.Add((IntPtr)UserItem1);
                                                        if (PlayObject.m_btRaceServer == Grobal2.RC_PLAYOBJECT)
                                                        {
                                                            PlayObject.SendAddItem(UserItem1);
                                                            PlayObject.SendUpdateItem(UserItem1);// 更新物品
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    Marshal.FreeHGlobal((IntPtr)UserItem1);
                                                }
                                            }
                                        }
                                        PlayObject.m_MakeWineTime = 0;
                                        PlayObject.n_MakeWineItmeType = 0;
                                        PlayObject.n_MakeWineQuality = 0;// 酿酒后,应该可以得到酒的品质
                                        PlayObject.n_MakeWineAlcohol = 0;// 酿酒后,应该可以得到酒的酒精度
                                        if (PlayObject.m_PEnvir == this.m_PEnvir)
                                        {
                                            GotoLable(PlayObject, "@EndMakeWine", false); // 酿酒完毕
                                        }
                                    }
                                    else
                                    {
                                        PlayObject.DropItemDown(UserItem, 3, false, false, PlayObject, PlayObject); // 扔物品
                                    }
                                }
                                else
                                {
                                    Marshal.FreeHGlobal((IntPtr)UserItem);
                                }
                            }
                        }
                        if ((PlayObject.m_MakeWineTime > 0) && (PlayObject.m_PEnvir == this.m_PEnvir))
                        {
                            GotoLable(PlayObject, "@NoMakeWineTimeOver", false);  // 时间还没有到
                        }
                    }
                    else
                    {
                        if (PlayObject.m_PEnvir == this.m_PEnvir)
                        {
                            GotoLable(PlayObject, "@NoMakeWine", false); // 没有酿酒
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETGOODMAKEWINE");
            }
        }

        /// <summary>
        /// 功能:减少酿酒的时间 
        /// 格式:DECMAKEWINETIME N(秒) D(1,2) X(0,1)
        /// 参数:D-1普通酒 2-药酒
        /// X-0按指定值减少,1-减少时间在1分钟内
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfDECMAKEWINETIME(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nMakeWineType;
            byte nCode;
            uint mMakeWineTime;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            mMakeWineTime = (uint)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);// 缩短时间
            nMakeWineType = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);// 酒类型
            nCode = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);// 操作类型
            try
            {
                if (((this) as TMerchant).m_boPlayMakeWine) // 酿酒NPC标识
                {
                    if (PlayObject.m_boMakeWine) // 在NPC处正在酿酒
                    {
                        if (PlayObject.n_MakeWineType == nMakeWineType)
                        {
                            switch (nCode)// 酒的类型一致
                            {
                                case 0:// 按指定的值减少时间
                                    PlayObject.m_MakeWineTime = Convert.ToUInt16(HUtil32._MAX(0, Convert.ToInt32(PlayObject.m_MakeWineTime - mMakeWineTime)));
                                    GotoLable(PlayObject, "@DecMakeWineTimeOK", false);
                                    break;
                                case 1:// 时间缩短在一分钟内
                                    PlayObject.m_MakeWineTime = Convert.ToUInt16(60 - HUtil32.Random(10));
                                    GotoLable(PlayObject, "@DecMakeWineTimeOK", false);
                                    break;
                            }
                        }
                        else
                        {
                            GotoLable(PlayObject, "@NoIsInMakeWine", false);// 没有酿酒
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@NoIsInMakeWine", false);// 没有酿酒
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDECMAKEWINETIME");
            }
        }

        /// <summary>
        /// 功能:酿酒NPC的走动
        /// 格式:MAKEWINENPCMOVE
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMAKEWINENPCMOVE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (!PlayObject.bo_NPCMove) // 是否点击,让NPC走动(防止不停的点击)
                {
                    if (PlayObject.m_boMakeWine) // 在NPC处正在酿酒
                    {
                        PlayObject.bo_NPCMove = true;
                        this.SendRefMsg(Grobal2.RM_NPCWALK, this.m_btDirection, this.m_nCurrX, this.m_nCurrY, 0, "");
                    }
                    else
                    {
                        GotoLable(PlayObject, "@NoIsInMakeWine", false);// 没有酿酒
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMAKEWINENPCMOVE");
            }
        }

        /// <summary>
        /// 功能:设置泉水喷发
        /// 格式:FOUNTAIN 地图 X Y 时间(秒)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfFOUNTAIN(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nX;
            int nY;
            int nTime;
            TEnvirnoment Envir;
            string sMap;
            TFlowerEvent FlowerEvent;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 地图ID 支持变量
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);// X
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);// Y
                nTime = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam4), 0);// Time
                if (sMap == "")
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sFOUNTAIN);
                    return;
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);// 查找地图场景
                if (Envir != null)
                {
                    if (M2Share.g_EventManager.GetEvent(Envir, nX, nY, Grobal2.ET_FOUNTAIN) != null)
                    {
                        return;  // 如果有场景了,就直接退出
                    }
                    FlowerEvent = new TFlowerEvent(Envir, nX, nY, Grobal2.ET_FOUNTAIN, Convert.ToUInt32(nTime * 1000));
                    M2Share.g_EventManager.AddEvent(FlowerEvent);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfFOUNTAIN");
            }
        }

        /// <summary>
        /// 功能:开启/关闭行会泉水仓库 
        /// 格式:SETGUILDFOUNTAIN 0/1 (0-开,1-关)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfSETGUILDFOUNTAIN(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nCode;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nCode = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);
                if ((nCode < 0) && (!new ArrayList(new int[] { 0, 1 }).Contains(nCode)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSETGUILDFOUNTAIN);
                    return;
                }
                if ((PlayObject.m_MyGuild != null) && (PlayObject.m_nGuildRankNo == 1))
                {
                    switch (nCode)
                    {
                        case 0:
                            PlayObject.m_MyGuild.boChanged = true;
                            PlayObject.m_MyGuild.boGuildFountainOpen = true;
                            GotoLable(PlayObject, "@OpenGuildFountain", false);
                            break;
                        case 1:
                            PlayObject.m_MyGuild.boChanged = true;
                            PlayObject.m_MyGuild.boGuildFountainOpen = false;
                            GotoLable(PlayObject, "@CloseGuildFountain", false);
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSETGUILDFOUNTAIN");
            }
        }
    
        /// <summary>
        /// 功能:领取行会泉水
        /// 格式:GIVEGUILDFOUNTAIN 物品名 数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfGIVEGUILDFOUNTAIN(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            string sItemName;
            int nItemCount;
            int nDate = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItemName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 增加变量支持
                nItemCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// 属性 支持变量
                if (nItemCount < 0)
                {
                    nItemCount = QuestActionInfo.nParam2;
                }
                //nDate = Convert.ToInt32(FormatDatetime("YYYYMMDD", DateTime.Today));// 当前的日期
                if (PlayObject.m_MyGuild != null)
                {
                    if (PlayObject.m_MyGuild.boGuildFountainOpen) // 行会泉水仓库开启
                    {
                        if (PlayObject.m_GiveGuildFountationDate != nDate)
                        {
                            if (PlayObject.m_MyGuild.m_nGuildFountain >= M2Share.g_Config.nMinGuildFountain) // 行会蓄量不能少于指定值
                            {
                                PlayObject.m_MyGuild.boChanged = true;
                                PlayObject.m_MyGuild.m_nGuildFountain = HUtil32._MAX(0, PlayObject.m_MyGuild.m_nGuildFountain - M2Share.g_Config.nDecGuildFountain);
                                PlayObject.m_GiveGuildFountationDate = nDate;// 领取泉水的日期
                                if (UserEngine.GetStdItemIdx(sItemName) > 0)
                                {
                                    if (!(nItemCount >= 1 && nItemCount <= 50))
                                    {
                                        nItemCount = 1;
                                    }
                                    for (int I = 0; I < nItemCount; I++)
                                    {
                                        if (PlayObject.IsEnoughBag())
                                        {
                                            UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                            if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                            {
                                                PlayObject.m_ItemList.Add((IntPtr)UserItem);
                                                PlayObject.SendAddItem(UserItem);
                                                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                                if (StdItem->NeedIdentify == 1)
                                                {
                                                    M2Share.AddGameDataLog("35" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" 
                                                        + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + sItemName + "\09" 
                                                        + (UserItem->MakeIndex).ToString()
                                                        + "\09" + "1" + "\09" + this.m_sCharName);
                                                }
                                            }
                                            else
                                            {
                                                Marshal.FreeHGlobal((IntPtr)UserItem);
                                            }
                                        }
                                        else
                                        {
                                            UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                            if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                            {
                                                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                                if (StdItem->NeedIdentify == 1)
                                                {
                                                    M2Share.AddGameDataLog("35" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() 
                                                        + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + sItemName 
                                                        + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "1" + "\09" + this.m_sCharName);
                                                }
                                                PlayObject.DropItemDown(UserItem, 3, false, false, PlayObject, PlayObject);
                                            }
                                            Marshal.FreeHGlobal((IntPtr)UserItem);
                                        }
                                    }
                                }
                                GotoLable(PlayObject, "@GIVEFOUNTAIN_OK", false);// 领取成功
                            }
                            else
                            {
                                GotoLable(PlayObject, "@NOGIVEFOUNTAIN", false); // 行会泉水量不足
                            }
                        }
                        else
                        {
                            GotoLable(PlayObject, "@NOGIVEFOUNTAIN1", false);// 已领取过泉水
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@GIVEFOUNTAINColse", false);// 行会酒泉关闭
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGIVEGUILDFOUNTAIN");
            }
        }

        /// <summary>
        /// 功能:NPC学习内功 
        /// 格式:READSKILLNG Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfREADSKILLNG(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("HERO").ToLower()) == 0)// 英雄学习
                {
                    if ((PlayObject.m_MyHero != null) && (PlayObject.m_boTrainingNG))// 主号学过,英雄才能学习
                    {
                        if (!((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG) // 没学过内功
                        {
                            ((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG = true;
                            ((THeroObject)(PlayObject.m_MyHero)).m_NGLevel = 1;
                            ((THeroObject)(PlayObject.m_MyHero)).m_ExpSkill69 = 0;// 内功当前经验
                            PlayObject.m_MyHero.SendNGData();// 发送内功数据
                            PlayObject.m_MyHero.SendRefMsg(Grobal2.RM_MYSHOW, Grobal2.ET_OBJECTLEVELUP, 0, 0, 0, "");// 人物升级动画 
                            GotoLable(PlayObject, "@ReadNGHeroOK", false);
                        }
                        else
                        {
                            GotoLable(PlayObject, "@ReadNGHeroFail", false);
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@ReadNGHeroFail", false);
                    }
                }
                else
                {
                    if (!PlayObject.m_boTrainingNG)// 没学过内功
                    {
                        PlayObject.m_boTrainingNG = true;
                        PlayObject.m_NGLevel = 1;
                        PlayObject.m_ExpSkill69 = 0;// 内功当前经验
                        PlayObject.SendNGData();// 发送内功数据
                        PlayObject.SendRefMsg(Grobal2.RM_MYSHOW, Grobal2.ET_OBJECTLEVELUP, 0, 0, 0, "");// 人物升级动画 
                        GotoLable(PlayObject, "@ReadNGOK", false);
                    }
                    else
                    {
                        GotoLable(PlayObject, "@ReadNGFail", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfREADSKILLNG");
            }
        }
    
        /// <summary>
        /// 功能:挑战地图移动
        /// 格式:CHALLENGMAPMOVE 地图名 X Y
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHALLENGMAPMOVE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nX;
            int nY;
            TEnvirnoment Envir;
            string sMap;
            bool m_boMoveOK;
            try
            {
                if ((PlayObject.m_ChallengeCreat == null) || (!PlayObject.m_boChallengeing))
                {
                    return;
                }
                m_boMoveOK = false;
                sMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 地图ID 支持变量
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);// X
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);// Y
                if (sMap == "")
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sCHALLENGMAPMOVE);
                    return;
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);// 查找地图场景
                if (Envir != null)  // 判断地图是否存在
                {
                    m_boMoveOK = true;
                    if (Envir.m_boFight4Zone)  // 并且是挑战地图
                    {
                        if (PlayObject.m_ChallengeCreat.m_MyHero != null)
                        {
                            PlayObject.m_ChallengeCreat.ClientHeroLogOut(1);  // 英雄退出,没有提示
                        }
                        if (PlayObject.m_MyHero != null)
                        {
                            PlayObject.ClientHeroLogOut(1); // 英雄退出,没有提示
                        }
                        PlayObject.m_sLastMapName = PlayObject.m_sMapName;
                        PlayObject.m_ChallengeCreat.m_sLastMapName = PlayObject.m_ChallengeCreat.m_sMapName;
                        PlayObject.m_ChallengeCreat.MapRandomMove(sMap, 0);
                        PlayObject.MapRandomMove(sMap, 0);
                        PlayObject.m_ChallengeTime = M2Share.g_Config.nChallengeTime;// 挑战计时
                        PlayObject.m_ChallengeCreat.m_ChallengeTime = M2Share.g_Config.nChallengeTime;// 挑战计时
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sCHALLENGMAPMOVE);
                    return;
                }
                if (!m_boMoveOK)
                {
                    if (M2Share.g_FunctionNPC != null)
                    {
                        M2Share.g_FunctionNPC.GotoLable(PlayObject, "@Challenge_Fail", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHALLENGMAPMOVE");
            }
        }

        /// <summary>
        /// 功能:没有挑战地图可移动,则退回抵押的物品
        /// 格式:GETCHALLENGEBAKITEM
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGETCHALLENGEBAKITEM(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((PlayObject.m_ChallengeCreat == null) || (!PlayObject.m_boChallengeing))
                {
                    return;
                }
                PlayObject.m_boChallengeing = false;
                if (PlayObject.m_ChallengeCreat != null)
                {
                    PlayObject.m_ChallengeCreat.m_boChallengeing = false;
                    PlayObject.m_ChallengeCreat.GetBackChallengeItems();
                    PlayObject.m_ChallengeCreat.m_ChallengeCreat = null;
                    PlayObject.m_ChallengeCreat.m_ChallengeLastTick = HUtil32.GetTickCount();
                }
                PlayObject.m_ChallengeCreat = null;
                PlayObject.GetBackChallengeItems();

                PlayObject.m_ChallengeLastTick = HUtil32.GetTickCount();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETCHALLENGEBAKITEM");
            }
        }

        /// <summary>
        /// 功能:人物在线英雄下线
        /// 格式:HEROLOGOUT
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfHEROLOGOUT(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            PlayObject.ClientHeroLogOut(0);// 英雄退出
        }
        
        /// <summary>
        /// 功能:修改魔法ID,并且等级为4
        /// 格式:CHANGESKILL 原魔法ID 新魔法ID Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfCHANGESKILL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TMagic* Magic;
            TUserMagic* UserMagic = null;
            TUserMagic* UserMagic1 = null;
            ushort oldMagic = 0;
            ushort NewMagic = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                oldMagic = (ushort)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                NewMagic = (ushort)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        return;
                    }
                    Magic = UserEngine.FindHeroMagic(NewMagic);
                    if (Magic != null)
                    {
                        if (PlayObject.m_MyHero != null)
                        {
                            if (!PlayObject.m_MyHero.IsTrainingSkill(Magic->wMagicId))
                            {
                                for (int I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                                {
                                    if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                                    {
                                        break;
                                    }
                                    UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                                    if (UserMagic != null)
                                    {
                                        if (UserMagic->MagicInfo.wMagicId == oldMagic)
                                        {
                                            UserMagic1->MagicInfo = *Magic;
                                            UserMagic1->wMagIdx = Magic->wMagicId;
                                            UserMagic1->btKey = UserMagic->btKey;
                                            UserMagic1->btLevel = 4;
                                            UserMagic1->MagicInfo.btTrainLv = 3;
                                            UserMagic1->nTranPoint = UserMagic1->MagicInfo.MaxTrain[3];
                                            PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                                            ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                                            PlayObject.m_MyHero.m_MagicList.Add((IntPtr)UserMagic1);
                                            ((THeroObject)(PlayObject.m_MyHero)).SendAddMagic(UserMagic1);
                                            ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                                            PlayObject.m_MyHero.CompareSuitItem(false);// 套装
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    Magic = UserEngine.FindMagic(NewMagic);
                    if (Magic != null)
                    {
                        if (!PlayObject.IsTrainingSkill(Magic->wMagicId))
                        {
                            for (int I = PlayObject.m_MagicList.Count - 1; I >= 0; I--)
                            {
                                if (PlayObject.m_MagicList.Count <= 0)
                                {
                                    break;
                                }
                                UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                                if (UserMagic != null)
                                {
                                    if (UserMagic->MagicInfo.wMagicId == oldMagic)
                                    {
                                        UserMagic1->MagicInfo = *Magic;
                                        UserMagic1->wMagIdx = Magic->wMagicId;
                                        UserMagic1->btKey = UserMagic->btKey;
                                        UserMagic1->btLevel = 4;
                                        UserMagic1->MagicInfo.btTrainLv = 3;
                                        UserMagic1->nTranPoint = UserMagic1->MagicInfo.MaxTrain[3];
                                        PlayObject.m_MagicList.RemoveAt(I);
                                        PlayObject.SendDelMagic(UserMagic);
                                        PlayObject.m_MagicList.Add((IntPtr)UserMagic1);
                                        PlayObject.SendAddMagic(UserMagic1);
                                        PlayObject.RecalcAbilitys();
                                        PlayObject.CompareSuitItem(false);// 套装
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCHANGESKILL");
            }
        }
    
        /// <summary>
        /// 功能:自动寻路
        /// 格式:AUTOGOTOXY X Y
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfAUTOGOTOXY(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nX;
            int nY;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);// X
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);// Y
                PlayObject.SendMsg(this, Grobal2.RM_AUTOGOTOXY, 0, nX, nY, 0, "");
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAUTOGOTOXY");
            }
        }

        /// <summary>
        /// 修理全身装备
        /// 格式：RepairAll (HERO)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfRepairAll(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nWhere;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        for (nWhere = m_UseItems.GetLowerBound(0); nWhere <= m_UseItems.GetUpperBound(0); nWhere++)
                        {
                            if (PlayObject.m_MyHero.m_UseItems[nWhere]->wIndex > 0)
                            {
                                StdItem = UserEngine.GetStdItem(PlayObject.m_MyHero.m_UseItems[nWhere]->wIndex);
                                if (StdItem != null)
                                {
                                    if (((PlayObject.m_MyHero.m_UseItems[nWhere]->DuraMax / 1000) > (PlayObject.m_MyHero.m_UseItems[nWhere]->Dura / 1000)) && (StdItem->StdMode != 7)
                                        && (StdItem->StdMode != 25) && (StdItem->StdMode != 43) && (StdItem->AniCount != 21))
                                    {
                                        if (this.CheckItemValue(PlayObject.m_MyHero.m_UseItems[nWhere], 3))  //禁止修
                                        {
                                            continue;
                                        }
                                        else if (PlayObject.m_MyHero.PlugOfCheckCanItem(3, HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), false, 0, 0)) // 禁止物品规则(管理插件功能)
                                        {
                                            continue;
                                        }
                                        PlayObject.m_MyHero.m_UseItems[nWhere]->Dura = PlayObject.m_MyHero.m_UseItems[nWhere]->DuraMax;
                                        PlayObject.SendMsg(PlayObject.m_MyHero, Grobal2.RM_HERODURACHANGE, nWhere, PlayObject.m_MyHero.m_UseItems[nWhere]->Dura, PlayObject.m_MyHero.m_UseItems[nWhere]->DuraMax, 0, "");
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    for (nWhere = m_UseItems.GetLowerBound(0); nWhere <= m_UseItems.GetUpperBound(0); nWhere++)
                    {
                        if (PlayObject.m_UseItems[nWhere]->wIndex > 0)
                        {
                            StdItem = UserEngine.GetStdItem(PlayObject.m_UseItems[nWhere]->wIndex);
                            if (StdItem != null)
                            {
                                if (((PlayObject.m_UseItems[nWhere]->DuraMax / 1000) > (PlayObject.m_UseItems[nWhere]->Dura / 1000)) && (StdItem->StdMode != 7) && (StdItem->StdMode != 25)
                                    && (StdItem->StdMode != 43) && (StdItem->AniCount != 21))
                                {
                                    if (this.CheckItemValue(PlayObject.m_UseItems[nWhere], 3))//禁止修
                                    {
                                        continue;
                                    }
                                    else if (PlayObject.PlugOfCheckCanItem(3, HUtil32.SBytePtrToString(StdItem->Name, 0, StdItem->NameLen), false, 0, 0))  // 禁止物品规则(管理插件功能)
                                    {
                                        continue;
                                    }
                                    PlayObject.m_UseItems[nWhere]->Dura = PlayObject.m_UseItems[nWhere]->DuraMax;
                                    PlayObject.SendMsg(PlayObject, Grobal2.RM_DURACHANGE, nWhere, PlayObject.m_UseItems[nWhere]->Dura, PlayObject.m_UseItems[nWhere]->DuraMax, 0, "");
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRepairAll");
            }
        }

        /// <summary>
        /// 踢除服务器所有人物
        /// 格式:KICKALLPLAY
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfKICKALLPLAY(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (UserEngine.m_PlayObjectList.Count > 0)
                {
                    for (int I = 0; I < UserEngine.m_PlayObjectList.Count; I++)
                    {
                        UserEngine.m_PlayObjectList[I].m_boKickFlag = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKICKALLPLAY");
            }
        }

        /// <summary>
        /// 功能：设置所有行会攻城
        /// 格式：ADDATTACKSABUKALL 城堡号
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfADDATTACKSABUKALL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserCastle Castle;
            int nIndex;
            TGUild Guild;
            try
            {
                nIndex = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);// 城堡ID
                Castle = M2Share.g_CastleManager.GetCastle(nIndex);
                if (GuildManager.GuildList.Count > 0)
                {
                    for (int I = 0; I < GuildManager.GuildList.Count; I++)
                    {
                        Guild = GuildManager.GuildList[I];
                        Castle.AddAttackerInfo(Guild, 1);
                        Castle.m_AttackGuildList.Add(Guild);//加入当前攻城列表
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfADDATTACKSABUKALL");
            }
        }

        /// <summary>
        /// 功能:连接指定网站网址
        /// 格式:WebBrowser http://www.baidu.com
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfWEBBROWSER(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string Url;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Url = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                if (Url == "")
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sWEBBROWSER);
                    return;
                }
                if (Url.IndexOf("http://") == 0)
                {
                    Url = "http://" + Url;
                }
                PlayObject.SendMsg(this, Grobal2.RM_Browser, 0, 0, 0, 0, Url);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfWEBBROWSER");
            }
        }

        /// <summary>
        /// 取指定排行榜指定排名的玩家名字 
        /// 格式:GETSORTNAME 变量 Type(排行榜) 名次
        /// nType 1-等级榜 2-战士榜 3-法师榜 4-道士榜
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGETSORTNAME(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte nType;
            int nIndex;
            int n14;
            TStringList StringList = null;
            string CharName = string.Empty;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);// 变量
                nType = (byte)QuestActionInfo.nParam2;// 排行榜类型
                nIndex = QuestActionInfo.nParam3;// 名次
                //if ((n14 < 600) || (!(int)nType >= 1 && !(int)nType<= 4) || (nIndex <= 0))
                //{
                //    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sGETSORTNAME);
                //    return;
                //}
                //EnterCriticalSection(M2Share.HumanSortCriticalSection);
                try
                {
                    switch (nType)
                    {
                        case 1:
                            StringList = UserEngine.m_PlayObjectLevelList;
                            break;
                        case 2:
                            StringList = UserEngine.m_WarrorObjectLevelList;
                            break;
                        case 3:
                            StringList = UserEngine.m_WizardObjectLevelList;
                            break;
                        case 4:
                            StringList = UserEngine.m_TaoistObjectLevelList;
                            break;
                    }
                    if (StringList != null)
                    {
                        if ((nIndex - 1) <= StringList.Count)
                        {
                            //CharName = ((string)(StringList[nIndex - 1]));
                            if (n14 >= 600)
                            {
                                switch (n14)
                                {
                                    // Modify the A .. B: 600 .. 699
                                    case 600:
                                        PlayObject.m_sString[n14 - 600] = CharName;
                                        break;
                                    // Modify the A .. B: 700 .. 799
                                    case 700:
                                        M2Share.g_Config.GlobalAVal[n14 - 700] = CharName;
                                        break;
                                    // Modify the A .. B: 1200 .. 1599
                                    case 1200:
                                        M2Share.g_Config.GlobalAVal[n14 - 1100] = CharName;
                                        break;
                                }
                            }
                        }
                    }
                }
                finally
                {

                    //  LeaveCriticalSection(M2Share.HumanSortCriticalSection);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGETSORTNAME");
            }
        }

        /// <summary>
        /// 功能：打开卧龙笔记
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfOPENBOOKS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (QuestActionInfo.nParam1 >= 0 && QuestActionInfo.nParam1 <= 5)
                {
                    PlayObject.SendMsg(this, Grobal2.RM_OPENBOOKS, 0, QuestActionInfo.nParam1, 0, 0, "");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENBOOKS");
            }
        }

        /// <summary>
        /// 功能：开通元宝交易
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfOPENYBDEAL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGameGold;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.bo_YBDEAL)// 如已开通元宝服务则退出
                {
                    PlayObject.SendMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/您已开通寄售服务,不需要再开通！！！\\ \\<返回/@main>");
                    return;  
                }
                nGameGold = HUtil32.Str_ToInt(QuestActionInfo.sParam1, 0);
                if (!(nGameGold > 0))
                {
                    nGameGold = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                }
                if (PlayObject.m_nGameGold >= nGameGold) // 玩家的元宝数大于或等于开通所需的元宝数
                {
                    PlayObject.m_nGameGold -= nGameGold;
                    PlayObject.bo_YBDEAL = true;
                    PlayObject.SendMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/开通寄售服务成功！！！\\ \\<返回/@main>");
                }
                else
                {
                    PlayObject.SendMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/您身上没有" + M2Share.g_Config.sGameGoldName + ",或" + M2Share.g_Config.sGameGoldName + "数不够！！！\\ \\<返回/@main>");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENYBDEAL");
            }
        }

        /// <summary>
        /// 功能：(元宝)查询正在出售的物品 
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private  void ActionOfQUERYYBSELL(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            //TDealOffInfo DealOffInfo;
            //string sSendStr = string.Empty;
            //string sUserItemName = string.Empty;
            //TClientDealOffInfo* sClientDealOffInfo = null;
            //TStdItem StdItem = null;
            //TStdItem StdItem80 = null;
            //TClientItem ClientDealUserItem;
            //TUserItem items = null;
            //bool bo12;
            //try
            //{
            //    if (QuestActionInfo.sParam6 == "88")
            //    {
            //        PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
            //        if (PlayObject == null)
            //        {
            //            return;
            //        }
            //    }
            //    bo12 = false;
            //    if (PlayObject.bo_YBDEAL)// 已开通元宝服务
            //    {
            //        if (PlayObject.SellOffInTime(0))
            //        {
            //            if (M2Share.sSellOffItemList.Count > 0)
            //            {
            //                for (int I = 0; I < M2Share.sSellOffItemList.Count; I++)
            //                {
            //                    DealOffInfo = M2Share.sSellOffItemList[I];
            //                    if (((DealOffInfo.sDealCharName).ToLower().CompareTo((PlayObject.m_sCharName).ToLower()) == 0)
            //                        && (new ArrayList(new int[] { 0, 3 }).Contains(DealOffInfo.N)))
            //                    {
            //                        for (int K = 0; K <= 9; K++)
            //                        {
            //                            StdItem = UserEngine.GetStdItem(DealOffInfo.UseItems[K]->wIndex);
            //                            if ((StdItem == null))// 是金刚石
            //                            {
            //                                if (!bo12 && (DealOffInfo.UseItems[K].MakeIndex > 0) && (DealOffInfo.UseItems[K]->wIndex == ushort.MaxValue) && (DealOffInfo.UseItems[K]->Dura == ushort.MaxValue)
            //                                    && (DealOffInfo.UseItems[K]->DuraMax == ushort.MaxValue))
            //                                {
            //                                    TClientItem* Item = (TClientItem*)sClientDealOffInfo->UseItemsBuff[K];// '金刚石'
            //                                    HUtil32.StrToSByteArry(M2Share.g_Config.sGameDiaMond + "(" + (DealOffInfo.UseItems[K].MakeIndex).ToString() + ")", Item->s.Name, 14, ref Item->s.NameLen);
            //                                    Item->s.Price = DealOffInfo.UseItems[K].MakeIndex;// 金刚石数量
            //                                    Item->Dura = ushort.MaxValue;// 客户端金刚石特征 
            //                                    Item->s.DuraMax = ushort.MaxValue;// 客户端金刚石特征 
            //                                    Item->s.Looks = ushort.MaxValue;// 不显示图片
            //                                    bo12 = true;
            //                                }
            //                                else
            //                                {
            //                                    ClientDealUserItem = (TClientItem*)sClientDealOffInfo->UseItemsBuff;
            //                                    HUtil32.StrToSByteArry("", ClientDealUserItem->s.Name, 14, ref ClientDealUserItem->s.NameLen);
            //                                }
            //                                continue;
            //                            }
            //                            StdItem80 = StdItem;
            //                            *items = DealOffInfo.UseItems[K];
            //                            ItemUnit.GetItemAddValue(items, StdItem80);
            //                            ClientDealUserItem = (TClientItem*)sClientDealOffInfo->UseItemsBuff;
            //                            ClientDealUserItem[K].s = StdItem80;
            //                            //Move(StdItem80, sClientDealOffInfo.UseItems[K].s, sizeof(TStdItem));
            //                            sUserItemName = "";// 取自定义物品名称
            //                            if (items->btValue[13] == 1)
            //                            {
            //                                sUserItemName = ItemUnit.GetCustomItemName(DealOffInfo.UseItems[K].MakeIndex, DealOffInfo.UseItems[K]->wIndex);
            //                            }
            //                            if (items->btValue[12] == 1)// 物品发光
            //                            {
            //                                ClientDealUserItem[K].s.Reserved1 = 1;
            //                            }
            //                            else
            //                            {
            //                                ClientDealUserItem[K].s.Reserved1 = 0;
            //                            }
            //                            if (sUserItemName != "")
            //                            {
            //                                HUtil32.StrToSByteArry(sUserItemName, ClientDealUserItem[K].s.Name, 14, ref ClientDealUserItem[K].s.NameLen);
            //                                //ClientDealUserItem[K].s->Name = sUserItemName;
            //                            }
            //                            ClientDealUserItem[K].MakeIndex = DealOffInfo.UseItems[K].MakeIndex;
            //                            ClientDealUserItem[K]->Dura = DealOffInfo.UseItems[K]->Dura;
            //                            ClientDealUserItem[K]->DuraMax = DealOffInfo.UseItems[K]->DuraMax;
            //                            switch (StdItem.StdMode)
            //                            {
            //                                case 15:
            //                                case 19:
            //                                case 26:
            //                                    if (items->btValue[8] != 0)
            //                                    {
            //                                        ClientDealUserItem[K].s.Shape = 130;
            //                                    }
            //                                    break;
            //                                case 60:
            //                                    if ((StdItem.Shape != 0)) // 酒类,除烧酒外
            //                                    {
            //                                        if (items->btValue[0] != 0)
            //                                        {
            //                                            ClientDealUserItem[K].s.AC = items->btValue[0]; // 酒的品质
            //                                        }
            //                                        if (items->btValue[1] != 0)
            //                                        {
            //                                            ClientDealUserItem[K].s.MAC = items->btValue[1]; // 酒的酒精度
            //                                        }
            //                                    }
            //                                    break;
            //                            }
            //                        }
            //                        //sClientDealOffInfo->sDealCharName = DealOffInfo->sDealCharName;
            //                        //sClientDealOffInfo->sBuyCharName = DealOffInfo->sBuyCharName;


            //                        HUtil32.StrToSByteArry(DealOffInfo.sDealCharName,
            //                            sClientDealOffInfo->sDealCharName, 14, ref  sClientDealOffInfo->DealCharNameLen);//出售者

            //                        HUtil32.StrToSByteArry(DealOffInfo.sBuyCharName,
            //                            sClientDealOffInfo->sBuyCharName, 14, ref  sClientDealOffInfo->BuyCharNameLen);//购买者

            //                        sClientDealOffInfo->dSellDateTime = DealOffInfo.dSellDateTime;
            //                        sClientDealOffInfo->nSellGold = DealOffInfo.nSellGold;
            //                        sClientDealOffInfo->N = DealOffInfo.N;
            //                        byte[] data = new byte[sizeof(TClientDealOffInfo)];
            //                        fixed (byte* pb = data) {
            //                            sSendStr = EncryptUnit.EncodeBuffer(data, sizeof(TClientDealOffInfo)); 
            //                        }
            //                        PlayObject.SendMsg(this, Grobal2.RM_QUERYYBSELL, 0, 0, 0, 0, sSendStr);
            //                        break;
            //                    }
            //                }
            //            }
            //        }
            //        else
            //        {
            //            GotoLable(PlayObject, "@AskYBSellFail", false);
            //        }
            //    }
            //    else
            //    {
            //        PlayObject.SendMsg(PlayObject, Grobal2.RM_MENU_OK, 0, PlayObject.ToInt(), 0, 0, "您未开通元宝寄售服务,请先开通！！！");
            //    }
            //}
            //catch
            //{
            //    M2Share.MainOutMessage("{异常} TNormNpc.ActionOfQUERYYBSELL");
            //}
        }

        /// <summary>
        /// 功能：(元宝)查询可以的购买物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfQueryYbDeal(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            //TDealOffInfo DealOffInfo;
            //string sSendStr;
            //string sUserItemName;
            //TClientDealOffInfo* sClientDealOffInfo = null;
            //TStdItem StdItem;
            //TStdItem StdItem80;
            //TClientItem ClientDealUserItem;
            //TUserItem items = null;
            //bool bo12;
            //try
            //{
            //    if (QuestActionInfo.sParam6 == "88")
            //    {
            //        PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
            //        if (PlayObject == null)
            //        {
            //            return;
            //        }
            //    }
            //    bo12 = false;
            //    if (PlayObject.bo_YBDEAL) // 已开通元宝服务
            //    {
            //        if (PlayObject.SellOffInTime(1))
            //        {
            //            if (M2Share.sSellOffItemList.Count > 0)
            //            {
            //                for (int I = 0; I < M2Share.sSellOffItemList.Count; I++)
            //                {
            //                    DealOffInfo = M2Share.sSellOffItemList[I];
            //                    if (((DealOffInfo.sBuyCharName).CompareTo((PlayObject.m_sCharName).ToLower()) == 0) && (DealOffInfo.N == 0))
            //                    {
            //                        for (int K = 0; K <= 9; K++)
            //                        {
            //                            StdItem = UserEngine.GetStdItem(DealOffInfo.UseItems[K]->wIndex);
            //                            if (StdItem == null)// 是金刚石
            //                            {
            //                                if (!bo12 && (DealOffInfo.UseItems[K].MakeIndex > 0) && (DealOffInfo.UseItems[K]->wIndex == ushort.MaxValue) &&
            //                                    (DealOffInfo.UseItems[K]->Dura == ushort.MaxValue)
            //                                    && (DealOffInfo.UseItems[K]->DuraMax == ushort.MaxValue))
            //                                {
            //                                    TClientItem* Item = (TClientItem*)sClientDealOffInfo->UseItemsBuff[K];// '金刚石'
            //                                    HUtil32.StrToSByteArry(M2Share.g_Config.sGameDiaMond + "(" + (DealOffInfo.UseItems[K].MakeIndex).ToString() + ")", Item->s.Name, 14, ref Item->s.NameLen);
            //                                    Item->s.Price = DealOffInfo.UseItems[K].MakeIndex; // 金刚石数量
            //                                    Item->Dura = ushort.MaxValue; // 客户端金刚石特征
            //                                    Item->s.DuraMax = ushort.MaxValue; // 客户端金刚石特征
            //                                    Item->s.Looks = ushort.MaxValue; // 不显示图片
            //                                    bo12 = true;
            //                                }
            //                                else
            //                                {
            //                                    ClientDealUserItem = (TClientItem*)sClientDealOffInfo->UseItemsBuff;
            //                                    HUtil32.StrToSByteArry("", ClientDealUserItem->s.Name, 14, ref ClientDealUserItem->s.NameLen);
            //                                }
            //                                continue;
            //                            }
            //                            StdItem80 = StdItem;
            //                            *items = DealOffInfo.UseItems[K];
            //                            ItemUnit.GetItemAddValue(items, StdItem80);
            //                            ClientDealUserItem = (TClientItem*)sClientDealOffInfo->UseItemsBuff;
            //                            ClientDealUserItem[K].s = StdItem80;
            //                            sUserItemName = "";// 取自定义物品名称
            //                            if (items->btValue[13] == 1)
            //                            {
            //                                sUserItemName = ItemUnit.GetCustomItemName(DealOffInfo.UseItems[K].MakeIndex, DealOffInfo.UseItems[K]->wIndex);
            //                            }
            //                            if (items->btValue[12] == 1)// 物品发光
            //                            {
            //                                ClientDealUserItem[K].s.Reserved1 = 1;
            //                            }
            //                            else
            //                            {
            //                                ClientDealUserItem[K].s.Reserved1 = 0;
            //                            }
            //                            if (sUserItemName != "")
            //                            {
            //                                HUtil32.StrToSByteArry(sUserItemName, ClientDealUserItem[K].s.Name, 14, ref ClientDealUserItem[K].s.NameLen);
            //                                //ClientDealUserItem[K].s->Name = sUserItemName;
            //                            }
            //                            ClientDealUserItem[K].MakeIndex = DealOffInfo.UseItems[K].MakeIndex;
            //                            ClientDealUserItem[K]->Dura = DealOffInfo.UseItems[K]->Dura;
            //                            ClientDealUserItem[K]->DuraMax = DealOffInfo.UseItems[K]->DuraMax;
            //                            switch (StdItem.StdMode)
            //                            {
            //                                case 15:
            //                                case 19:
            //                                case 26:
            //                                    if (items->btValue[8] != 0)
            //                                    {
            //                                        ClientDealUserItem[K].s.Shape = 130;
            //                                    }
            //                                    break;
            //                                case 60:
            //                                    if ((StdItem.Shape != 0))  // 酒类,除烧酒外
            //                                    {
            //                                        if (items->btValue[0] != 0)
            //                                        {
            //                                            ClientDealUserItem[K].s.AC = items->btValue[0];  // 酒的品质
            //                                        }
            //                                        if (items->btValue[1] != 0)
            //                                        {
            //                                            ClientDealUserItem[K].s.MAC = items->btValue[1];   // 酒的酒精度
            //                                        }
            //                                    }
            //                                    break;
            //                            }
            //                        }
            //                        HUtil32.StrToSByteArry(DealOffInfo.sDealCharName,
            //                            sClientDealOffInfo->sDealCharName, 14, ref  sClientDealOffInfo->DealCharNameLen);//出售者
            //                        HUtil32.StrToSByteArry(DealOffInfo.sBuyCharName,
            //                            sClientDealOffInfo->sBuyCharName, 14, ref  sClientDealOffInfo->BuyCharNameLen);//购买者
            //                        sClientDealOffInfo->dSellDateTime = DealOffInfo.dSellDateTime;
            //                        sClientDealOffInfo->nSellGold = DealOffInfo.nSellGold;
            //                        sClientDealOffInfo->N = DealOffInfo.N;
            //                        byte[] data = new byte[sizeof(TClientDealOffInfo)];
            //                        fixed (byte* pb = data) {
            //                            *(TClientDealOffInfo*)pb = *sClientDealOffInfo;
            //                        }
            //                        sSendStr = EncryptUnit.EncodeBuffer(data, sizeof(TClientDealOffInfo));
            //                        PlayObject.SendMsg(this, Grobal2.RM_QUERYYBDEAL, 0, 0, 0, 0, sSendStr);
            //                        break;
            //                    }
            //                }
            //            }
            //        }
            //        else
            //        {
            //            GotoLable(PlayObject, "@AskYBDealFail", false);
            //        }
            //    }
            //    else
            //    {
            //        PlayObject.SendMsg(PlayObject, Grobal2.RM_MENU_OK, 0, PlayObject.ToInt(), 0, 0, "您未开通元宝寄售服务,请先开通！！！");
            //    }
            //}
            //catch
            //{
            //    M2Share.MainOutMessage("{异常} TNormNpc.ActionOfQUERYYBDEAL");
            //}
        }
 
        /// <summary>
        /// 功能：改变穿人模式
        /// THROUGHHUM M S M:模式[-1=恢复/0=穿人穿怪/1=穿怪/2=穿人] S:时间(秒)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfTHROUGHHUM(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMode;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMode = QuestActionInfo.nParam1;// 模式[-1=恢复/0=穿人穿怪/1=穿怪/2=穿人]
                PlayObject.dwRunHumanModeTime = Convert.ToUInt32(QuestActionInfo.nParam2 * 1000);
                switch (nMode)
                {
                    case -1:// 时间(秒)
                        M2Share.g_Config.boRUNHUMAN = M2Share.Config.ReadBool("Setup", "RunHuman", M2Share.g_Config.boRUNHUMAN);
                        M2Share.g_Config.boRUNMON = M2Share.Config.ReadBool("Setup", "RunMon", M2Share.g_Config.boRUNMON);
                        break;
                    case 0:
                        M2Share.g_Config.boRUNHUMAN = true;// 穿人
                        M2Share.g_Config.boRUNMON = true;// 穿怪
                        PlayObject.dwRunHumanModeTick = HUtil32.GetTickCount();
                        PlayObject.m_boRunHumanMode = true;
                        break;
                    case 1:
                        M2Share.g_Config.boRUNMON = true;// 穿怪
                        PlayObject.dwRunHumanModeTick = HUtil32.GetTickCount();
                        PlayObject.m_boRunHumanMode = true;
                        break;
                    case 2:
                        M2Share.g_Config.boRUNHUMAN = true;// 穿人
                        PlayObject.dwRunHumanModeTick = HUtil32.GetTickCount();
                        PlayObject.m_boRunHumanMode = true;
                        break;
                }
                PlayObject.SendServerConfig();// 发送配置信息到客户端
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTHROUGHHUM");
            }
        }

        /// <summary>
        /// 功能：装备发光设置  
        /// 格式:SetItemsLight 装备位置(0-12) 是否发光(1发光，0不发光)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfSetItemsLight(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nItem;
            int nLight;
            TUserItem* UserItem;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nItem = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);// 装备位置
                nLight = HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0);// 是否发光
                if (nItem < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nItem);
                }
                if (nLight < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLight);
                }
                if ((nItem < 0) || (nItem > m_UseItems.GetUpperBound(0)) || (new ArrayList(new int[] { 0, 1 }).Contains(~nLight)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSETITEMSLIGHT);
                    return;
                }
                UserItem = PlayObject.m_UseItems[nItem];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    // PlayObject.SysMsg('你身上没有戴指定物品！！！', c_Red, t_Hint);
                    return;
                }
                UserItem->btValue[12] = (byte)nLight;
                PlayObject.SendUpdateItem(UserItem);// 更新物品
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetItemsLight");
            }
        }

        /// <summary>
        /// 功能：打开卧龙宝藏   
        /// 格式:OpenDragonBoxs 5  打开5类型的宝箱
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfOpenDragonBox(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nItem = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);// 宝箱类型
                if (nItem < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nItem);
                }
                if (nItem < 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sOPENDRAGONBOX);
                    return;
                }
                if (PlayObject.ClientOpenBoxs(nItem))// 宝箱开启
                {
                    PlayObject.SendMsg(this, Grobal2.RM_OPENDRAGONBOXS, 0, 0, 0, 0, "");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOpenDragonBox");
            }
        }
        
        /// <summary>
        /// 功能：打开淬炼功能窗口
        /// 格式: QUERYREFINEITEM
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfQUERYREFINEITEM(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((!PlayObject.m_boDeath) && (!PlayObject.m_boGhost))
                {
                    PlayObject.SendMsg(this, Grobal2.RM_QUERYREFINEITEM, 0, 0, 0, 0, "");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfQUERYREFINEITEM");
            }
        }

        /// <summary>
        /// 功能：移动到回城点 
        /// 格式: GOHOME
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGOHOME(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((!PlayObject.m_boDeath) && (!PlayObject.m_boGhost))
                {
                    PlayObject.MoveToHome();// 移动到回城点
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGOHOME");
            }
        }

        public bool ActionOfTHROWITEM_GetDropRandomPosition(int nOrgX, int nOrgY, int nRange, ref int nDX, ref int nDY)
        {
            bool result = false;
            int nItemCount = 0;
            int n24;
            int n28;
            int n2C;
            n24 = 999;
            result = false;
            n28 = 0;
            n2C = 0;
            for (int I = 1; I <= nRange; I++)
            {
                for (int II = -I; II <= I; II++)
                {
                    for (int III = -I; III <= I; III++)
                    {
                        nDX = nOrgX + HUtil32.Random(nRange) + III;
                        nDY = nOrgY + HUtil32.Random(nRange) + II;
                        if (this.m_PEnvir.GetItemEx(nDX, nDY, ref nItemCount) == null)
                        {
                            if (this.m_PEnvir.bo2C)
                            {
                                result = true;
                                break;
                            }
                        }
                        else
                        {
                            if (this.m_PEnvir.bo2C && (n24 > nItemCount))
                            {
                                n24 = nItemCount;
                                n28 = nDX;
                                n2C = nDY;
                            }
                        }
                    }
                    if (result)
                    {
                        break;
                    }
                }
                if (result)
                {
                    break;
                }
            }
            if (!result)
            {
                if (n24 < 8)
                {
                    nDX = n28;
                    nDY = n2C;
                }
                else
                {
                    nDX = nOrgX;
                    nDY = nOrgY;
                }
            }
            return result;
        }

        /// <summary>
        /// 功能：将指定物品刷新到指定地图坐标范围内
        /// 格式：THROWITEM 地图 X Y 范围 物品名称 数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfTHROWITEM(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMap;
            string sItemName;
            string sUserItemName;
            int I;
            int idura = 0;
            int nX = 0;
            int nY = 0;
            int nRange = 0;
            int nCount = 0;
            int dX = 0;
            int dY = 0;
            TEnvirnoment Envir;
            TMapItem MapItem;
            TMapItem pr = null;
            TStdItem* StdItem;
            TUserItem* UserItem = null;
            try
            {
                // ----------------------------------------------------------------------------------------
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                // ======================================================================
                sMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 地图 支持变量
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// X 支持变量
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);// Y 支持变量
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam4), -1);// 范围 支持变量
                sItemName = GetLineVariableText(PlayObject, QuestActionInfo.sParam5);// 物品名称 支持变量
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam6), -1);// 数量 支持变量
                if ((sMap == "") || (nX < 0) || (nY < 0) || (nRange < 0) || (sItemName == "") || (nCount <= 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sTHROWITEM);
                    return;
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);// 查找地图,地图不存在则退出
                if (Envir == null)
                {
                    return;
                }
                if (nCount <= 0)
                {
                    nCount = 1;
                }
                for (I = 0; I < nCount; I++)
                {
                    UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                    if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                    {
                        if (this.CheckItemValue(UserItem, 5))
                        {
                            return;
                        }
                        // 是否禁止爆出
                        StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                        if (StdItem != null)
                        {
                            if (StdItem->StdMode == 40)
                            {
                                idura = UserItem->Dura;
                                idura = idura - 2000;
                                if (idura < 0)
                                {
                                    idura = 0;
                                }
                                UserItem->Dura = (ushort)idura;
                            }
                            MapItem = new TMapItem();
                            MapItem.UserItem = UserItem;
                            MapItem.Name = HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen);// 取自定义物品名称
                            sUserItemName = "";
                            if (UserItem->btValue[13] == 1)
                            {
                                sUserItemName = ItemUnit.GetCustomItemName(UserItem->MakeIndex, UserItem->wIndex);
                                if (sUserItemName != "")
                                {
                                    MapItem.Name = sUserItemName;
                                }
                            }
                            MapItem.Looks = StdItem->Looks;
                            if (StdItem->StdMode == 45)
                            {
                                MapItem.Looks = (ushort)M2Share.GetRandomLook(MapItem.Looks, StdItem->Shape);
                            }
                            MapItem.AniCount = StdItem->AniCount;
                            MapItem.Reserved = 0;
                            MapItem.Count = 1;
                            MapItem.OfBaseObject = null;
                            MapItem.dwCanPickUpTick = HUtil32.GetTickCount();
                            MapItem.DropBaseObject = null;
                            ActionOfTHROWITEM_GetDropRandomPosition(nX, nY, nRange, ref dX, ref dY);//取掉物品的位置
                            pr = (TMapItem)Envir.AddToMap(dX, dY, Grobal2.OS_ITEMOBJECT, MapItem);
                            if (pr == MapItem)
                            {
                                this.SendRefMsg(Grobal2.RM_ITEMSHOW, MapItem.Looks, MapItem.ToInt(), dX, dY, MapItem.Name);
                            }
                            else
                            {
                                Dispose(MapItem);
                                break;
                            }
                        }
                    }
                    else
                    {
                        Marshal.FreeHGlobal((IntPtr)UserItem);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTHROWITEM");
            }
        }

        /// <summary>
        /// 功能: 删除指定文本里的编码
        /// 格式: CLEARCODELIST 玩家变量 文本路径
        /// 例子: CLEARCODELIST <$STR(S1)> ..\questdiary\冲值\500元卡号.txt
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCLEARCODELIST(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TStringList LoadList = null;
            string sPlayID;
            string sLine;
            string sFileName;
            try
            {
                try
                {
                    if (QuestActionInfo.sParam6 == "88")
                    {
                        PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                        if (PlayObject == null)
                        {
                            return;
                        }
                    }
                    sPlayID = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                    if ((sPlayID == ""))
                    {
                        GetValValue(PlayObject, QuestActionInfo.sParam1, ref sPlayID);
                    }
                    sFileName = QuestActionInfo.sParam2;// 文本路径
                    if (sFileName[0] == '\\')
                    {
                        sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
                    }
                    if (sFileName[1] == '\\')
                    {
                        sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
                    }
                    if (sFileName[2] == '\\')
                    {
                        sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
                    }
                    sFileName = M2Share.g_Config.sEnvirDir + sFileName;
                    LoadList = new TStringList();
                    if (File.Exists(sFileName))
                    {
                        LoadList.LoadFromFile(sFileName);
                        if (LoadList.Count > 0)
                        {
                            for (int I = 0; I < LoadList.Count; I++)
                            {
                                sLine = LoadList[I].Trim();
                                if ((sLine == "") || (sLine[0] == ';'))
                                {
                                    continue;
                                }
                                if ((sLine).ToLower().CompareTo((sPlayID).ToLower()) == 0)
                                {
                                    LoadList.RemoveAt(I);
                                    LoadList.SaveToFile(sFileName);
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sCLEARCODELIST);
                    }
                }
                finally
                {

                    Dispose(LoadList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCLEARCODELIST");
            }
        }

        public bool ActionOfGetRandomName_GetValNameValue(TPlayObject PlayObject, string sVarName, ref string sValue, ref int nValue, ref int nDataType)
        {
            bool result = false;
            nValue = -1;
            sValue = "";
            nDataType = -1;
            int n100 = M2Share.GetValNameNo(sVarName);
            if (n100 >= 0)
            {
                if (HUtil32.rangeInDefined(n100, 0, 99))
                {
                    nValue = PlayObject.m_nVal[n100];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 100, 199))
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 100];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 200, 299))
                {
                    nValue = PlayObject.m_DyVal[n100 - 200];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 300, 399))
                {
                    nValue = PlayObject.m_nMval[n100 - 300];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 400, 499))
                {
                    nValue = M2Share.g_Config.GlobaDyMval[n100 - 400];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 500, 599))
                {
                    nValue = PlayObject.m_nInteger[n100 - 500];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 600, 699))
                {
                    sValue = PlayObject.m_sString[n100 - 600];
                    nDataType = 0;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 700, 799))
                {
                    sValue = M2Share.g_Config.GlobalAVal[n100 - 700];
                    nDataType = 0;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 800, 1199))
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 700];//G变量
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 1200, 1599))
                {
                    sValue = M2Share.g_Config.GlobalAVal[n100 - 1100];// A变量
                    nDataType = 0;
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            else
            {
                result = false;
            }
            return result;
        }

        public bool ActionOfGetRandomName_SetValNameValue(TPlayObject PlayObject, string sVarName, string sValue, int nValue, int nDataType)
        {
            bool result = false;
            int n100 = M2Share.GetValNameNo(sVarName);
            if (n100 >= 0)
            {
                switch (nDataType)
                {
                    case 1:
                        if (HUtil32.rangeInDefined(n100, 0, 99))
                        {
                            PlayObject.m_nVal[n100] = nValue;
                            result = true;
                            break;
                        }
                        else if (HUtil32.rangeInDefined(n100, 100, 199))
                        {
                            M2Share.g_Config.GlobalVal[n100 - 100] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 200, 299))
                        {
                            PlayObject.m_DyVal[n100 - 200] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 300, 399))
                        {
                            PlayObject.m_nMval[n100 - 300] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 400, 499))
                        {
                            M2Share.g_Config.GlobaDyMval[n100 - 400] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 500, 599))
                        {
                            PlayObject.m_nInteger[n100 - 500] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 800, 1199))// G变量
                        {
                            M2Share.g_Config.GlobalVal[n100 - 700] = nValue;
                            result = true;
                        }
                        else
                        {
                            result = false;
                        }
                        break;
                    case 0:
                        if (HUtil32.rangeInDefined(n100, 600, 699))
                        {
                            PlayObject.m_sString[n100 - 600] = sValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 700, 799))
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 700] = sValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 1200, 1599))//A变量(100-499)
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 1100] = sValue;
                            result = true;
                        }
                        else
                        {
                            result = false;
                        }
                        break;
                    case 3:
                        if (HUtil32.rangeInDefined(n100, 0, 99))
                        {
                            PlayObject.m_nVal[n100] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 100, 199))
                        {
                            M2Share.g_Config.GlobalVal[n100 - 100] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 200, 299))
                        {
                            PlayObject.m_DyVal[n100 - 200] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 300, 399))
                        {
                            PlayObject.m_nMval[n100 - 300] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 400, 499))
                        {
                            M2Share.g_Config.GlobaDyMval[n100 - 400] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 500, 599))
                        {
                            PlayObject.m_nInteger[n100 - 500] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 600, 699))
                        {
                            PlayObject.m_sString[n100 - 600] = sValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 700, 799))
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 700] = sValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 800, 1199))//G变量
                        {
                            M2Share.g_Config.GlobalVal[n100 - 700] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 1200, 1599))//A变量
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 1100] = sValue;
                            result = true;
                        }
                        else
                        {
                            result = false;

                        }
                        break;
                }
            }
            else
            {
                result = false;
            }
            return result;
        }

        /// <summary>
        /// 功能: 从文件中随机取文本   格式：GetRandomName 文本(全路径) 字符串变量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfGetRandomName(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TStringList LoadList;
            string sFileName;
            string MonName;
            string sValue = string.Empty;
            string sParam2 = string.Empty;
            int I = 0;
            int K = 0;
            int nValue = 0;
            int nDataType = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                MonName = "";
                if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))
                {
                    HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref sParam2);
                }
                else
                {
                    sParam2 = QuestActionInfo.sParam2;
                }
                sFileName = QuestActionInfo.sParam1;// 文本(全路径)
                if (sFileName[0] == '\\')
                {
                    sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
                }
                if (sFileName[1] == '\\')
                {
                    sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
                }
                if (sFileName[2] == '\\')
                {
                    sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
                }
                sFileName = GetLineVariableText(PlayObject, sFileName);// 文件路径支持变量
                sFileName = M2Share.g_Config.sEnvirDir + sFileName;
                if (File.Exists(sFileName))
                {
                    LoadList = new TStringList();
                    try
                    {
                        LoadList.LoadFromFile(sFileName);
                        if (LoadList.Count > 0)
                        {
                            for (I = 0; I < LoadList.Count; I++)
                            {
                                K = HUtil32.Random(LoadList.Count);
                                MonName = LoadList[K];
                                if (MonName != "")
                                {
                                    break;
                                }
                            }
                        }
                    }
                    finally
                    {

                        Dispose(LoadList);
                    }
                }
                if (MonName != "")
                {
                    // 传值过程
                    if (ActionOfGetRandomName_GetValNameValue(PlayObject, sParam2, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!ActionOfGetRandomName_SetValNameValue(PlayObject, sParam2, MonName, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sGETRANDOMNAME);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGetRandomName");
            }
        }

        /// <summary>
        /// 功能: 通过脚本命令让别人执行QManage.txt中的脚本 
        /// 格式：HCall 人物名称 标签
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfHCall(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TPlayObject User;
            string UserName;
            string sLable;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                UserName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 人物名称 支持变量
                sLable = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);// 标签 支持变量
                if ((UserName == "") || (sLable == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sHCall);
                    return;
                }
                User = UserEngine.GetPlayObject(UserName);
                if (User != null)
                {
                    if (M2Share.g_ManageNPC != null)
                    {
                        M2Share.g_ManageNPC.GotoLable(User, sLable, false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfHCall");
            }
        }

        // -----------------------------------------------------------------------------
        /// <summary>
        /// 功能: 检测人物是否在攻城期间的范围内，在则BB叛变
        /// 格式：INCASTLEWARAY
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfINCASTLEWARAY(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserCastle Castle;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                Castle = M2Share.g_CastleManager.InCastleWarArea(PlayObject);
                if ((Castle != null) && Castle.m_boUnderWar)
                {
                    if (PlayObject.m_SlaveList.Count > 0)
                    {
                        for (int I = PlayObject.m_SlaveList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_SlaveList.Count <= 0)
                            {
                                break;
                            }
                            if (PlayObject.m_SlaveList[I].m_btRaceServer != Grobal2.RC_PLAYMOSTER)
                            {
                                PlayObject.m_SlaveList[I].m_dwMasterRoyaltyTick = 0;
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfINCASTLEWARAY");
            }
        }

        /// <summary>
        /// 功能：给予带绑定状态装备。主要方便设置不能配带的装备绑定状态
        /// 格式： GIVESTATEITEM 物品名称 项目1 项目2 项目3 项目4 项目5 项目6(0为正常,1为绑定) 
        /// 项目1--给予禁止扔，项目2--禁止交易，项目3--禁止存，项目4--禁止修，项目5--禁止出售,项目6--禁止爆出的装备
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfGIVESTATEITEM(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sItmeName;
            byte n1;
            byte n2;
            byte n3;
            byte n4;
            byte n5;
            byte n6;
            TUserItem* UserItem;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItmeName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 物品名称 支持变量
                n1 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// 项目1 支持变量
                n2 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);// 项目2 支持变量
                n3 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam4), -1);// 项目3 支持变量
                n4 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam5), -1);// 项目4 支持变量
                n5 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam6), -1);// 项目5 支持变量
                n6 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam7), -1);// 项目6 支持变量
                if ((!(new ArrayList(new int[] { 0, 1 }).Contains(n1))) || (!(new ArrayList(new int[] { 0, 1 }).Contains(n2))) || (!(new ArrayList(new int[] { 0, 1 }).Contains(n3))) || 
                    (!(new ArrayList(new int[] { 0, 1 }).Contains(n4))) || (!(new ArrayList(new int[] { 0, 1 }).Contains(n5))) || (!(new ArrayList(new int[] { 0, 1 }).Contains(n6))) || (sItmeName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sGIVESTATEITEM);
                    return;
                }
                if (PlayObject.m_ItemList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_ItemList.Count; I++)// 人物包裹不为空
                    {
                        UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                        StdItem = UserEngine.GetStdItem(sItmeName);
                        if ((StdItem != null) && (UserItem->wIndex > 0))
                        {
                            UserItem->btValue[14] = n1;
                            UserItem->btValue[15] = n2;
                            UserItem->btValue[16] = n3;
                            UserItem->btValue[17] = n4;
                            UserItem->btValue[18] = n5;
                            UserItem->btValue[19] = n6;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGIVESTATEITEM");
            }
        }

        /// <summary>
        /// 功能：设置装备绑定状态。
        /// 格式：SETITEMSTATE 位置(0-13) 项目(0-5) 属性(0为正常,1为绑定)
        /// 项目: 0 禁止扔1 禁止交易 2 禁止存 3 禁止修 4 禁止出售 5 禁止爆出
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfSETITEMSTATE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            byte n1;
            byte n2;
            byte n3;
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                n1 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);// 位置 支持变量
                n2 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// 项目 支持变量
                n3 = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);// 属性 支持变量
                if ((!(n1 >= 0 && n1 <= 13)) || (!(n2 >= 0 && n2 <= 5)) || (!(new ArrayList(new int[] { 0, 1 }).Contains(n3))))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSETITEMSTATE);
                    return;
                }
                UserItem = PlayObject.m_UseItems[n1];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    // PlayObject.SysMsg('你身上没有戴指定物品！！！', c_Red, t_Hint);
                    return;
                }
                switch (n2)
                {
                    case 0:
                        // 项目
                        UserItem->btValue[14] = n3;
                        break;
                    case 1:
                        UserItem->btValue[15] = n3;
                        break;
                    case 2:
                        UserItem->btValue[16] = n3;
                        break;
                    case 3:
                        UserItem->btValue[17] = n3;
                        break;
                    case 4:
                        UserItem->btValue[18] = n3;
                        break;
                    case 5:
                        UserItem->btValue[19] = n3;
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSETITEMSTATE");
            }
        }

        private void ActionOfMarry(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TPlayObject PoseHuman;
            string sSayMsg;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_sDearName != "")
                {
                    return;
                }
                PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                if (PoseHuman == null)
                {
                    GotoLable(PlayObject, "@MarryCheckDir", false);
                    return;
                }
                if (QuestActionInfo.sParam1 == "")
                {
                    if (PoseHuman.m_btRaceServer != Grobal2.RC_PLAYOBJECT)
                    {
                        GotoLable(PlayObject, "@HumanTypeErr", false);
                        return;
                    }
                    if (PoseHuman.GetPoseCreate() == PlayObject)
                    {
                        if (PlayObject.m_btGender != PoseHuman.m_btGender)
                        {
                            GotoLable(PlayObject, "@StartMarry", false);
                            GotoLable(PoseHuman, "@StartMarry", false);
                            if ((PlayObject.m_btGender == 0) && (PoseHuman.m_btGender == 1))
                            {
                                sSayMsg = GameMsgDef.g_sStartMarryManMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                                sSayMsg = GameMsgDef.g_sStartMarryManAskQuestionMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                            }
                            else if ((PlayObject.m_btGender == 1) && (PoseHuman.m_btGender == 0))
                            {
                                sSayMsg = GameMsgDef.g_sStartMarryWoManMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                                sSayMsg = GameMsgDef.g_sStartMarryWoManAskQuestionMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                            }
                            PlayObject.m_boStartMarry = true;
                            PoseHuman.m_boStartMarry = true;
                        }
                        else
                        {
                            GotoLable(PoseHuman, "@MarrySexErr", false);
                            GotoLable(PlayObject, "@MarrySexErr", false);
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@MarryDirErr", false);
                        GotoLable(PoseHuman, "@MarryCheckDir", false);
                    }
                    return;
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("REQUESTMARRY").ToLower()) == 0)
                {
                    if (PlayObject.m_boStartMarry && PoseHuman.m_boStartMarry)
                    {
                        if ((PlayObject.m_btGender == 0) && (PoseHuman.m_btGender == 1))
                        {
                            sSayMsg = GameMsgDef.g_sMarryManAnswerQuestionMsg.Replace("%n", this.m_sCharName);
                            sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                            sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                            UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                            sSayMsg = GameMsgDef.g_sMarryManAskQuestionMsg.Replace("%n", this.m_sCharName);
                            sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                            sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                            UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                            GotoLable(PlayObject, "@WateMarry", false);
                            GotoLable(PoseHuman, "@RevMarry", false);
                        }
                    }
                    return;
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("RESPONSEMARRY").ToLower()) == 0)
                {
                    if ((PlayObject.m_btGender == 1) && (PoseHuman.m_btGender == 0))
                    {
                        if ((QuestActionInfo.sParam2).ToLower().CompareTo(("OK").ToLower()) == 0)
                        {
                            if (PlayObject.m_boStartMarry && PoseHuman.m_boStartMarry)
                            {
                                sSayMsg = GameMsgDef.g_sMarryWoManAnswerQuestionMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                                sSayMsg = GameMsgDef.g_sMarryWoManGetMarryMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                                GotoLable(PlayObject, "@EndMarry", false);
                                GotoLable(PoseHuman, "@EndMarry", false);
                                PlayObject.m_boStartMarry = false;
                                PoseHuman.m_boStartMarry = false;
                                PlayObject.m_sDearName = PoseHuman.m_sCharName;
                                PlayObject.m_DearHuman = PoseHuman;
                                PoseHuman.m_sDearName = PlayObject.m_sCharName;
                                PoseHuman.m_DearHuman = PlayObject;
                                PlayObject.RefShowName();
                                PoseHuman.RefShowName();
                            }
                        }
                        else
                        {
                            if (PlayObject.m_boStartMarry && PoseHuman.m_boStartMarry)
                            {
                                GotoLable(PlayObject, "@EndMarryFail", false);
                                GotoLable(PoseHuman, "@EndMarryFail", false);
                                PlayObject.m_boStartMarry = false;
                                PoseHuman.m_boStartMarry = false;
                                sSayMsg = GameMsgDef.g_sMarryWoManDenyMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                                sSayMsg = GameMsgDef.g_sMarryWoManCancelMsg.Replace("%n", this.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%s", PlayObject.m_sCharName);
                                sSayMsg = sSayMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sSayMsg, TMsgType.t_Say);
                            }
                        }
                    }
                    return;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMarry");
            }
        }

        /// <summary>
        /// 功能：收徒或拜师
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMaster(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TPlayObject PoseHuman;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_sMasterName != "")
                {
                    return;
                }
                PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                if (PoseHuman == null)
                {
                    GotoLable(PlayObject, "@MasterCheckDir", false);
                    return;
                }
                if (QuestActionInfo.sParam1 == "")
                {
                    if (PoseHuman.m_btRaceServer != Grobal2.RC_PLAYOBJECT)
                    {
                        GotoLable(PlayObject, "@HumanTypeErr", false);
                        return;
                    }
                    if (PoseHuman.GetPoseCreate() == PlayObject)
                    {
                        GotoLable(PlayObject, "@StartGetMaster", false);
                        GotoLable(PoseHuman, "@StartMaster", false);
                        PlayObject.m_boStartMaster = true;
                        PoseHuman.m_boStartMaster = true;
                    }
                    else
                    {
                        GotoLable(PlayObject, "@MasterDirErr", false);
                        GotoLable(PoseHuman, "@MasterCheckDir", false);
                    }
                    return;
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("REQUESTMASTER").ToLower()) == 0)
                {
                    if (PlayObject.m_boStartMaster && PoseHuman.m_boStartMaster)
                    {
                        PlayObject.m_PoseBaseObject = PoseHuman;
                        PoseHuman.m_PoseBaseObject = PlayObject;
                        GotoLable(PlayObject, "@WateMaster", false);
                        GotoLable(PoseHuman, "@RevMaster", false);
                    }
                    return;
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("RESPONSEMASTER").ToLower()) == 0)
                {
                    if ((QuestActionInfo.sParam2).ToLower().CompareTo(("OK").ToLower()) == 0)
                    {
                        if ((PlayObject.m_PoseBaseObject == PoseHuman) && (PoseHuman.m_PoseBaseObject == PlayObject))
                        {
                            if ((PlayObject.m_MasterNoList.Count >= M2Share.g_Config.nMasterCount))  // 超过可收徒弟数,则退出
                            {
                                GotoLable(PoseHuman, "@EndMasterFail", false);// 提示拜师失败
                                GotoLable(PlayObject, "@EndMasterFail", false);// 提示拜师失败
                                return;
                            }
                            if (PlayObject.m_boStartMaster && PoseHuman.m_boStartMaster)
                            {
                                GotoLable(PlayObject, "@EndMaster", false);
                                GotoLable(PoseHuman, "@EndMaster", false);
                                PlayObject.m_boStartMaster = false;
                                PoseHuman.m_boStartMaster = false;
                                PlayObject.m_boMaster = true;
                                PlayObject.AddMaster(PoseHuman.m_sCharName);// 收徒
                                PlayObject.m_MasterList.Add(PoseHuman);
                                PoseHuman.m_sMasterName = PlayObject.m_sCharName;
                                PoseHuman.m_boMaster = false;
                                PoseHuman.GetMasterNoList();// 取排名
                                PlayObject.RefShowName();
                                PoseHuman.RefShowName();
                            }
                        }
                    }
                    else
                    {
                        if (PlayObject.m_boStartMaster && PoseHuman.m_boStartMaster)
                        {
                            GotoLable(PlayObject, "@EndMasterFail", false);
                            GotoLable(PoseHuman, "@EndMasterFail", false);
                            PlayObject.m_boStartMaster = false;
                            PoseHuman.m_boStartMaster = false;
                        }
                    }
                    return;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMaster");
            }
        }

        /// <summary>
        /// 功能：游戏对话框
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMessageBox(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sParam1 = string.Empty;
            string Str;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sParam1 = QuestActionInfo.sParam1;
                GetValValue(PlayObject, QuestActionInfo.sParam1, ref sParam1);
                Str = GetLineVariableText(PlayObject, sParam1);
                if ((QuestActionInfo.sParam2 != "") && (QuestActionInfo.sParam2.IndexOf("@") > 0))
                {
                    Str = Str + "/" + QuestActionInfo.sParam2;
                }
                if ((QuestActionInfo.sParam3 != "") && (QuestActionInfo.sParam3.IndexOf("@") > 0))
                {
                    Str = Str + "/" + QuestActionInfo.sParam3;
                }
                PlayObject.SendMsg(this, Grobal2.RM_MENU_OK, 0, PlayObject.ToInt(), 0, 0, Str);
                PlayObject.m_nUserCmdNPC = this;// 新添加 需测试
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMessageBox");
            }
        }

        private void ActionOfMission(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.sParam1 != "") && (QuestActionInfo.nParam2 > 0) && (QuestActionInfo.nParam3 > 0))
                {
                    M2Share.g_sMissionMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                    M2Share.g_nMissionX = QuestActionInfo.nParam2;
                    M2Share.g_nMissionY = QuestActionInfo.nParam3;
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MISSION);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMission");
            }
        }

        /// <summary>
        /// 功能：安全区光环设置
        /// 命令格式: MOBFIREBURN MAP X Y TYPE TIME POINT
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMobFireBurn(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMAP;
            int nX;
            int nY;
            int nType;
            int nTime;
            int nPoint;
            TFireBurnEvent FireBurnEvent;
            TEnvirnoment Envir;
            TEnvirnoment OldEnvir;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMAP = QuestActionInfo.sParam1;
                nX = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                nY = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);
                nType = HUtil32.Str_ToInt(QuestActionInfo.sParam4, -1);
                nTime = HUtil32.Str_ToInt(QuestActionInfo.sParam5, -1);
                nPoint = HUtil32.Str_ToInt(QuestActionInfo.sParam6, -1);
                if ((sMAP == "") || (nX < 0) || (nY < 0) || (nType < 0) || (nTime < 0) || (nPoint < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MOBFIREBURN);
                    return;
                }
                Envir = M2Share.g_MapManager.FindMap(sMAP);
                if (Envir != null)
                {
                    OldEnvir = PlayObject.m_PEnvir;
                    PlayObject.m_PEnvir = Envir;
                    FireBurnEvent = new TFireBurnEvent(PlayObject, nX, nY, nType, Convert.ToUInt32(nTime * 1000), nPoint);
                    M2Share.g_EventManager.AddEvent(FireBurnEvent);
                    PlayObject.m_PEnvir = OldEnvir;
                    return;
                }
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MOBFIREBURN);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMobFireBurn");
            }
        }

        /// <summary>
        /// 放置怪物，怪物向集中点集中
        /// 命令格式: MobPlace 怪物名称 是否内功怪 模式(0/1 1-魔王岭新模式)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        /// <param name="nX"></param>
        /// <param name="nY"></param>
        /// <param name="nCount"></param>
        /// <param name="nRange"></param>
        private void ActionOfMobPlace(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo, int nX, int nY, int nCount, int nRange)
        {
            int nRandX;
            int nRandY;
            TBaseObject mon;
            string sMonName;
            bool boIsNGMon;
            bool boMode = false;// 是否新模式
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMonName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 怪物名,支持变量
                boIsNGMon = HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0) != 0;
                if (QuestActionInfo.sParam3 != "")
                {
                    boMode = true;
                }
                if (nCount <= 0)
                {
                    nCount = 1;
                }
                for (int I = 0; I < nCount; I++)
                {
                    if (boMode && (PlayObject.m_sMapName136 != ""))// 魔王岭使用
                    {
                        mon = UserEngine.RegenMonsterByName(PlayObject.m_sMapName136, UserEngine.m_nCurrX_136, UserEngine.m_nCurrY_136, sMonName);
                    }
                    else
                    {
                        nRandX = HUtil32.Random(nRange * 2 + 1) + (nX - nRange);
                        nRandY = HUtil32.Random(nRange * 2 + 1) + (nY - nRange);
                        mon = UserEngine.RegenMonsterByName(M2Share.g_sMissionMap, nRandX, nRandY, sMonName);
                    }
                    if (mon != null)
                    {
                        mon.m_boIsNGMonster = boIsNGMon;
                        if (!boMode)
                        {
                            mon.m_boMission = true;
                            mon.m_nMissionX = M2Share.g_nMissionX;
                            mon.m_nMissionY = M2Share.g_nMissionY;
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MOBPLACE);
                        break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMobPlace");
            }
        }

        public int ActionOfSetRankLevelName_SubStrConut(string mStr, string mSub)
        {
            int result;
            // 判断'<$Str('字符出现字符串中的次数
            result = (mStr.Length - mStr.Replace(mSub, "").Length) / mSub.Length;
            return result;
        }

        private void ActionOfSetRankLevelName(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            bool boVarFound;
            string sRankLevelName;
            string sTemp;
            string sTemp1 = string.Empty;
            int n10;
            const string sVarFound = "变量%s不存在，变量类型:%s";
            const string sVarTypeError = "变量类型错误，错误类型:%s 当前支持类型(HUMAN、GUILD、GLOBAL)";
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sRankLevelName = QuestActionInfo.sParam1;
                if (sRankLevelName == "")
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETRANKLEVELNAME);
                    return;
                }
                if (QuestActionInfo.sParam2 != "")
                {
                    boVarFound = false;
                    DynamicVarList = GetDynamicVarList(PlayObject, sRankLevelName, ref sName);
                    if (DynamicVarList == null)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sRankLevelName }), QuestActionInfo, M2Share.sSC_SETRANKLEVELNAME);
                        return;
                    }
                    if (DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((QuestActionInfo.sParam2).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        sRankLevelName = (DynamicVar.nInternet).ToString();
                                        break;
                                    case TVarType.vString:
                                        sRankLevelName = DynamicVar.sString;
                                        break;
                                }
                                boVarFound = true;
                                break;
                            }
                        }
                    }
                    if (!boVarFound)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { QuestActionInfo.sParam2, QuestActionInfo.sParam1 }), QuestActionInfo, M2Share.sSC_SETRANKLEVELNAME);
                        return;
                    }
                }
                else
                {
                    int I = ActionOfSetRankLevelName_SubStrConut(sRankLevelName, "<$STR(");
                    if (I > 0)
                    {
                        sTemp = sRankLevelName;
                        sRankLevelName = "";
                        for (int K = 0; K < I; K++)
                        {
                            sTemp = HUtil32.ArrestStringEx(sTemp, "(", ")", ref sTemp1);
                            n10 = M2Share.GetValNameNo(sTemp1);
                            if (n10 >= 0)
                            {
                                switch (n10)
                                {
                                    // Modify the A .. B: 600 .. 699
                                    case 600:
                                        if (PlayObject.m_sString[n10 - 600] != "")
                                        {
                                            if (sRankLevelName != "")
                                            {
                                                sRankLevelName = sRankLevelName + "\\";
                                            }
                                            sRankLevelName = sRankLevelName + PlayObject.m_sString[n10 - 600];
                                        }
                                        break;
                                    // Modify the A .. B: 700 .. 799
                                    case 700:
                                        if (M2Share.g_Config.GlobalAVal[n10 - 700] != "")
                                        {
                                            if (sRankLevelName != "")
                                            {
                                                sRankLevelName = sRankLevelName + "\\";
                                            }
                                            sRankLevelName = sRankLevelName + M2Share.g_Config.GlobalAVal[n10 - 700];
                                        }
                                        break;
                                    // Modify the A .. B: 1200 .. 1599
                                    case 1200:
                                        // 20080903 A变量(100-499)
                                        if (M2Share.g_Config.GlobalAVal[n10 - 1100] != "")
                                        {
                                            if (sRankLevelName != "")
                                            {
                                                sRankLevelName = sRankLevelName + "\\";
                                            }
                                            sRankLevelName = sRankLevelName + M2Share.g_Config.GlobalAVal[n10 - 1100];
                                        }
                                        break;
                                }
                            }
                        }
                    }
                    else
                    {
                        n10 = M2Share.GetValNameNo(sRankLevelName);
                        if (n10 >= 0)
                        {
                            switch (n10)
                            {
                                // Modify the A .. B: 600 .. 699
                                case 600:
                                    sRankLevelName = PlayObject.m_sString[n10 - 600];
                                    break;
                                // Modify the A .. B: 700 .. 799
                                case 700:
                                    sRankLevelName = M2Share.g_Config.GlobalAVal[n10 - 700];
                                    break;
                                // Modify the A .. B: 1200 .. 1599
                                case 1200:
                                    //A变量(100-499)
                                    sRankLevelName = M2Share.g_Config.GlobalAVal[n10 - 1100];
                                    break;
                            }
                        }
                    }
                }
                if (sRankLevelName == "")
                {
                    sRankLevelName = GameMsgDef.g_sRankLevelName;
                }
                else if (sRankLevelName.IndexOf("%s") <= 0)
                {
                    sRankLevelName = "%s\\" + sRankLevelName;
                }
                PlayObject.m_sRankLevelName = sRankLevelName;
                PlayObject.RefShowName();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetRankLevelName");
            }
        }

        private void ActionOfSetScriptFlag(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            bool boFlag;
            int nWhere;
            try
            {   
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                boFlag = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1) == 1;
                switch (nWhere)
                {
                    case 0:
                        PlayObject.m_boSendMsgFlag = boFlag;
                        break;
                    case 1:
                        PlayObject.m_boChangeItemNameFlag = boFlag;
                        break;
                    default:
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETSCRIPTFLAG);
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetScriptFlag");
            }
        }

        /// <summary>
        /// 功能：调整技能等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfSkillLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TMagic* Magic;
            TUserMagic* UserMagic;
            int nLevel;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nLevel = HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0);
                if (nLevel < 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SKILLLEVEL);
                    return;
                }
                cMethod = QuestActionInfo.sParam2[1];
                Magic = UserEngine.FindMagic(QuestActionInfo.sParam1);
                if (Magic != null)
                {
                    if (PlayObject.m_MagicList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_MagicList.Count; I++)
                        {
                            UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                            if (&UserMagic->MagicInfo == Magic)
                            {
                                switch (cMethod)
                                {
                                    case '=':
                                        if (nLevel >= 0)
                                        {
                                            nLevel = HUtil32._MAX(3, nLevel);
                                            UserMagic->btLevel = (byte)nLevel;
                                        }
                                        break;
                                    case '-':
                                        if (UserMagic->btLevel >= nLevel)
                                        {
                                            UserMagic->btLevel -= (byte)nLevel;
                                        }
                                        else
                                        {
                                            UserMagic->btLevel = 0;
                                        }
                                        break;
                                    case '+':
                                        if (UserMagic->btLevel + nLevel <= 3)
                                        {
                                            UserMagic->btLevel += (byte)nLevel;
                                        }
                                        else
                                        {
                                            UserMagic->btLevel = 3;
                                        }
                                        break;
                                }
                                PlayObject.SendDelayMsg(PlayObject, Grobal2.RM_MAGIC_LVEXP, 0, UserMagic->MagicInfo.wMagicId, UserMagic->btLevel, UserMagic->nTranPoint, "", 100);
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSkillLevel");
            }
        }

        /// <summary>
        /// 功能：调整英雄技能等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfHeroSkillLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TMagic* Magic;
            TUserMagic* UserMagic;
            int nLevel;
            char cMethod;
            bool isMagic4;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                isMagic4 = false;
                nLevel = HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0);
                if (nLevel < 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_HEROSKILLLEVEL);
                    return;
                }
                cMethod = QuestActionInfo.sParam2[1];
                if (PlayObject.m_MyHero != null)
                {
                    Magic = UserEngine.FindHeroMagic(QuestActionInfo.sParam1);
                    if (Magic != null)
                    {
                        if (new ArrayList(new int[] { 13, 26, 45 }).Contains(Magic->wMagicId))
                        {
                            isMagic4 = true;
                        }
                        if (PlayObject.m_MyHero.m_MagicList.Count > 0)
                        {
                            for (int I = 0; I < PlayObject.m_MyHero.m_MagicList.Count; I++)
                            {
                                UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                                if (&UserMagic->MagicInfo == Magic)
                                {
                                    switch (cMethod)
                                    {
                                        case '=':
                                            if (nLevel >= 0)
                                            {
                                                if (isMagic4)
                                                {
                                                    nLevel = HUtil32._MAX(4, nLevel);
                                                }
                                                else
                                                {
                                                    nLevel = HUtil32._MAX(3, nLevel);
                                                }
                                                UserMagic->btLevel = (byte)nLevel;
                                            }
                                            break;
                                        case '-':
                                            if (UserMagic->btLevel >= nLevel)
                                            {
                                                UserMagic->btLevel -= (byte)nLevel;
                                            }
                                            else
                                            {
                                                UserMagic->btLevel = 0;
                                            }
                                            break;
                                        case '+':
                                            if (isMagic4)
                                            {
                                                if (UserMagic->btLevel + nLevel <= 4)
                                                {
                                                    UserMagic->btLevel += (byte)nLevel;
                                                }
                                                else
                                                {
                                                    UserMagic->btLevel = 4;
                                                }
                                            }
                                            else
                                            {
                                                if (UserMagic->btLevel + nLevel <= 3)
                                                {
                                                    UserMagic->btLevel += (byte)nLevel;
                                                }
                                                else
                                                {
                                                    UserMagic->btLevel = 3;
                                                }
                                            }
                                            break;
                                    }
                                    PlayObject.SendDelayMsg(PlayObject, Grobal2.RM_HEROMAGIC_LVEXP, 0, UserMagic->MagicInfo.wMagicId, UserMagic->btLevel, UserMagic->nTranPoint, "", 100);
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    PlayObject.SysMsg("英雄不在线!", TMsgColor.c_Red, TMsgType.t_Hint); // 英雄不在线
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfHeroSkillLevel");
            }
        }

        private void ActionOfTakeCastleGold(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGold;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nGold = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                if (nGold < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nGold);
                }
                if ((nGold < 0) || (this.m_Castle == null))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_TAKECASTLEGOLD);
                    return;
                }
                if (nGold <= this.m_Castle.m_nTotalGold)
                {
                    this.m_Castle.m_nTotalGold -= nGold;
                }
                else
                {
                    this.m_Castle.m_nTotalGold = 0;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTakeCastleGol");
            }
        }

        // 离线挂机
        private void ActionOfNotLineAddPiont(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            uint dwAutoGetExpTime = 0;
            uint nAutoGetExpPoint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (!PlayObject.m_boNotOnlineAddExp)
                {
                    dwAutoGetExpTime = (uint)HUtil32.Str_ToInt(QuestActionInfo.sParam1, 0);
                    nAutoGetExpPoint = (uint)HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0);
                    if (dwAutoGetExpTime * 60 > uint.MaxValue)
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sOFFLINEPLAY);
                        return;
                    }
                    PlayObject.m_dwNotOnlineAddExpTime = dwAutoGetExpTime * 60;
                    PlayObject.m_nNotOnlineAddExpPoint = nAutoGetExpPoint;
                    PlayObject.m_boNotOnlineAddExp = true;// 是离线挂机
                    PlayObject.m_boStartAutoAddExpPoint = true;// 是否自动增加经验
                    PlayObject.m_dwAutoAddExpPointTimeTick = HUtil32.GetTickCount();
                    PlayObject.m_dwAutoAddExpPointTick = HUtil32.GetTickCount();
                    PlayObject.m_boKickAutoAddExpUser = false;
                    PlayObject.m_boAllowDeal = false;// 禁止交易
                    PlayObject.m_boAllowGuild = false;// 禁止加入行会
                    PlayObject.m_boAllowGroup = false;// 禁止组队
                    PlayObject.m_boCanMasterRecall = false;// 禁止师徒传送
                    PlayObject.m_boCanDearRecall = false;// 禁止夫妻传送
                    PlayObject.m_boAllowGuildReCall = false;// 禁止行会合一
                    PlayObject.m_boAllowGroupReCall = false;// 禁止天地合一
                    PlayObject.m_boOpenBox = false;// 宝箱初始化
                    PlayObject.ClearViewRange();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfNotLineAddPiont");
            }
        }

        private void ActionOfKickNotLineAddPiont(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_boNotOnlineAddExp)
                {
                    PlayObject.m_boPlayOffLine = false;
                    PlayObject.m_boReconnection = false;
                    PlayObject.m_boSoftClose = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKickNotLineAddPiont");
            }
        }

        private void ActionOfUnMarry(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TPlayObject PoseHuman;
            TStringList LoadList;
            string sUnMarryFileName;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_sDearName == "")
                {
                    GotoLable(PlayObject, "@ExeMarryFail", false);
                    return;
                }
                PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                if (PoseHuman == null)
                {
                    GotoLable(PlayObject, "@UnMarryCheckDir", false);
                }
                if (PoseHuman != null)
                {
                    if (QuestActionInfo.sParam1 == "")
                    {
                        if (PoseHuman.m_btRaceServer != Grobal2.RC_PLAYOBJECT)
                        {
                            GotoLable(PlayObject, "@UnMarryTypeErr", false);
                            return;
                        }
                        if (PoseHuman.GetPoseCreate() == PlayObject)
                        {
                            if ((PlayObject.m_sDearName == PoseHuman.m_sCharName))
                            {
                                GotoLable(PlayObject, "@StartUnMarry", false);
                                GotoLable(PoseHuman, "@StartUnMarry", false);
                                return;
                            }
                        }
                    }
                }
                if (((QuestActionInfo.sParam1).ToLower().CompareTo(("REQUESTUNMARRY").ToLower()) == 0))
                {
                    if ((QuestActionInfo.sParam2 == ""))
                    {
                        if (PoseHuman != null)
                        {
                            PlayObject.m_boStartUnMarry = true;
                            if (PlayObject.m_boStartUnMarry && PoseHuman.m_boStartUnMarry)
                            {
                                UserEngine.SendBroadCastMsg("[" + this.m_sCharName + "]: " + "我宣布" + PoseHuman.m_sCharName + " " + "与" + PlayObject.m_sCharName + " " 
                                    + " " + "正式脱离夫妻关系。", TMsgType.t_Say);
                                PlayObject.m_sDearName = "";
                                PoseHuman.m_sDearName = "";
                                PlayObject.m_btMarryCount++;
                                PoseHuman.m_btMarryCount++;
                                PlayObject.m_boStartUnMarry = false;
                                PoseHuman.m_boStartUnMarry = false;
                                PlayObject.RefShowName();
                                PoseHuman.RefShowName();
                                GotoLable(PlayObject, "@UnMarryEnd", false);
                                GotoLable(PoseHuman, "@UnMarryEnd", false);
                            }
                            else
                            {
                                GotoLable(PlayObject, "@WateUnMarry", false);
                                // GotoLable(PoseHuman,'@RevUnMarry',False);
                            }
                        }
                        return;
                    }
                    else
                    {
                        // 强行离婚
                        if (((QuestActionInfo.sParam2).ToLower().CompareTo(("FORCE").ToLower()) == 0))
                        {
                            UserEngine.SendBroadCastMsg("[" + this.m_sCharName + "]: " + "我宣布" + PlayObject.m_sCharName + " " + "与" + PlayObject.m_sDearName + " " 
                                + " " + "已经正式脱离夫妻关系！！！", TMsgType.t_Say);
                            PoseHuman = UserEngine.GetPlayObject(PlayObject.m_sDearName);
                            if (PoseHuman != null)
                            {
                                PoseHuman.m_sDearName = "";
                                PoseHuman.m_btMarryCount++;
                                PoseHuman.RefShowName();
                            }
                            else
                            {
                                sUnMarryFileName = M2Share.g_Config.sEnvirDir + "UnMarry.txt";
                                LoadList = new TStringList();
                                if (File.Exists(sUnMarryFileName))
                                {
                                    LoadList.LoadFromFile(sUnMarryFileName);
                                }
                                LoadList.Add(PlayObject.m_sDearName);
                                LoadList.SaveToFile(sUnMarryFileName);
                                Dispose(LoadList);
                            }
                            PlayObject.m_sDearName = "";
                            PlayObject.m_btMarryCount++;
                            GotoLable(PlayObject, "@UnMarryEnd", false);
                            PlayObject.RefShowName();
                        }
                        return;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfUnMarry");
            }
        }

        private void ActionOfStartTakeGold(TPlayObject PlayObject)
        {
            TPlayObject PoseHuman;
            try
            {
                PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                if ((PoseHuman != null) && (PoseHuman.GetPoseCreate() == PlayObject) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                {
                    PlayObject.m_nDealGoldPose = 1;
                    GotoLable(PlayObject, "@startdealgold", false);
                }
                else
                {
                    GotoLable(PlayObject, "@dealgoldpost", false);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfStartTakeGold");
            }
        }

        public virtual void ClearScript()
        {
            TScript Script = null;
            TSayingRecord SayingRecord = null;
            TSayingProcedure SayingProcedure = null;
            try
            {
                if (m_ScriptList.Count > 0)
                {
                    for (int I = 0; I < m_ScriptList.Count; I++)
                    {
                        Script = m_ScriptList[I];
                        if (Script.RecordList.Count > 0)
                        {
                            for (int II = 0; II < Script.RecordList.Count; II++)
                            {
                                SayingRecord = Script.RecordList[II];
                                if (SayingRecord.ProcedureList.Count > 0)
                                {
                                    for (int III = 0; III < SayingRecord.ProcedureList.Count; III++)
                                    {
                                        SayingProcedure = SayingRecord.ProcedureList[III];
                                        if (SayingProcedure.ConditionList.Count > 0)
                                        {
                                            for (int IIII = 0; IIII < SayingProcedure.ConditionList.Count; IIII++)
                                            {
                                                if (SayingProcedure.ConditionList[IIII] != null)
                                                {
                                                    Dispose(SayingProcedure.ConditionList[IIII]);
                                                }
                                            }
                                        }
                                        if (SayingProcedure.ActionList.Count > 0)
                                        {
                                            for (int IIII = 0; IIII < SayingProcedure.ActionList.Count; IIII++)
                                            {
                                                if (SayingProcedure.ActionList[IIII] != null)
                                                {
                                                    Dispose(SayingProcedure.ActionList[IIII]);
                                                }
                                            }
                                        }
                                        if (SayingProcedure.ElseActionList.Count > 0)
                                        {
                                            for (int IIII = 0; IIII < SayingProcedure.ElseActionList.Count; IIII++)
                                            {
                                                if (SayingProcedure.ElseActionList[IIII] != null)
                                                {
                                                    Dispose(SayingProcedure.ElseActionList[IIII]);
                                                }
                                            }
                                        }
                                        Dispose(SayingProcedure.ConditionList);
                                        Dispose(SayingProcedure.ActionList);
                                        Dispose(SayingProcedure.ElseActionList);
                                        Dispose(SayingProcedure);
                                    }
                                }
                                Dispose(SayingRecord.ProcedureList);
                                Dispose(SayingRecord);
                            }
                        }
                        Dispose(Script.RecordList);
                        Dispose(Script);
                    }
                }
                m_ScriptList.Clear();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ClearScript");
            }
        }

        /// <summary>
        /// 点击NPC
        /// </summary>
        /// <param name="PlayObject"></param>
        public virtual void Click(TPlayObject PlayObject)
        {
            try
            {
                if (!this.m_boGhost)
                {
                    if (PlayObject != null)
                    {
                        PlayObject.m_nScriptGotoCount = 0;
                        PlayObject.m_sScriptGoBackLable = "";
                        PlayObject.m_sScriptCurrLable = "";
                        GotoLable(PlayObject, "@main", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.Click");
            }
        }

        public bool ConditionOfCheckHP_CheckHigh(TPlayObject PlayObject, char cMethodMax, int nMax)
        {
            bool result = false;
            switch (cMethodMax)
            {
                case '=':
                    if (PlayObject.m_WAbil.MaxHP == nMax)
                    {
                        result = true;
                    }
                    break;
                case '>':
                    if (PlayObject.m_WAbil.MaxHP > nMax)
                    {
                        result = true;
                    }
                    break;
                case '<':
                    if (PlayObject.m_WAbil.MaxHP < nMax)
                    {
                        result = true;
                    }
                    break;
                default:
                    if (PlayObject.m_WAbil.MaxHP >= nMax)
                    {
                        result = true;
                    }
                    break;
            }
            return result;
        }

        public bool ConditionOfCheckMP_CheckHigh(TPlayObject PlayObject, char cMethodMax, int nMax)
        {
            bool result = false;
            switch (cMethodMax)
            {
                case '=':
                    if (PlayObject.m_WAbil.MaxMP == nMax)
                    {
                        result = true;
                    }
                    break;
                case '>':
                    if (PlayObject.m_WAbil.MaxMP > nMax)
                    {
                        result = true;
                    }
                    break;
                case '<':
                    if (PlayObject.m_WAbil.MaxMP < nMax)
                    {
                        result = true;
                    }
                    break;
                default:
                    if (PlayObject.m_WAbil.MaxMP >= nMax)
                    {
                        result = true;
                    }
                    break;
            }
            return result;
        }

        public bool ConditionOfCheckDC_CheckHigh(TPlayObject PlayObject, char cMethodMax, int nMax)
        {
            bool result = false;
            switch (cMethodMax)
            {
                case '=':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.DC) == nMax)
                    {
                        result = true;
                    }
                    break;
                case '>':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.DC) > nMax)
                    {
                        result = true;
                    }
                    break;
                case '<':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.DC) < nMax)
                    {
                        result = true;
                    }
                    break;
                default:

                    if (HUtil32.HiWord(PlayObject.m_WAbil.DC) >= nMax)
                    {
                        result = true;
                    }
                    break;
            }
            return result;
        }

        public bool ConditionOfCheckMC_CheckHigh(TPlayObject PlayObject, char cMethodMax, int nMax)
        {
            bool result = false;
            switch (cMethodMax)
            {
                case '=':
                    if (HUtil32.HiWord(PlayObject.m_WAbil.MC) == nMax)
                    {
                        result = true;
                    }
                    break;
                case '>':
                    if (HUtil32.HiWord(PlayObject.m_WAbil.MC) > nMax)
                    {
                        result = true;
                    }
                    break;
                case '<':
                    if (HUtil32.HiWord(PlayObject.m_WAbil.MC) < nMax)
                    {
                        result = true;
                    }
                    break;
                default:
                    if (HUtil32.HiWord(PlayObject.m_WAbil.MC) >= nMax)
                    {
                        result = true;
                    }
                    break;
            }
            return result;
        }

        public bool ConditionOfCheckSC_CheckHigh(TPlayObject PlayObject, char cMethodMax, int nMax)
        {
            bool result = false;
            switch (cMethodMax)
            {
                case '=':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.SC) == nMax)
                    {
                        result = true;
                    }
                    break;
                case '>':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.SC) > nMax)
                    {
                        result = true;
                    }
                    break;
                case '<':

                    if (HUtil32.HiWord(PlayObject.m_WAbil.SC) < nMax)
                    {
                        result = true;
                    }
                    break;
                default:

                    if (HUtil32.HiWord(PlayObject.m_WAbil.SC) >= nMax)
                    {
                        result = true;
                    }
                    break;
            }
            return result;
        }

        /// <summary>
        /// 功能:检查游戏币
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckGameGold(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nGameGold;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nGameGold = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGameGold < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGameGold))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGAMEGOLD);
                        return result;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_nGameGold == nGameGold)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_nGameGold > nGameGold)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_nGameGold < nGameGold)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_nGameGold >= nGameGold)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGameGold");
            }
            return result;
        }

        /// <summary>
        /// 功能：检查字符串的长度
        /// 格式：CheckStringlength 字符串 操作符(<,>,=) 位数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckStringlength(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nLength;
            string sMag;
            if (QuestConditionInfo.sParam6 == "88")
            {   
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            result = false;
            try
            {
                nLength = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);// 位数
                sMag = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 字符串
                if ((nLength < 0) || (sMag == ""))
                {
                    result = false;
                    // ScriptConditionError(PlayObject, QuestConditionInfo, sSC_CheckStringlength);
                    return result;
                }
                cMethod = QuestConditionInfo.sParam2[1];
                switch (cMethod)
                {
                    case '=':
                        if (sMag.Length == nLength)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (sMag.Length > nLength)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (sMag.Length < nLength)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (sMag.Length >= nLength)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckStringlength");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查荣誉值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckGameGLORY(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nGameGlory;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nGameGlory = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nGameGlory < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nGameGlory))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKGAMEGLORY);
                        return result;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_btGameGlory == nGameGlory)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_btGameGlory > nGameGlory)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_btGameGlory < nGameGlory)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_btGameGlory >= nGameGlory)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckGameGLORY");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查技能等级
        /// CHECKSKILLLEVEL 技能名 控制符(=,>,<) 等级数(0-3) HERO
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCHECKSKILLLEVEL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TUserMagic* UserMagic;
            int nLevel;
            string cMethod;
            string sMagicName;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nLevel = HUtil32._MIN(3, HUtil32.Str_ToInt(QuestConditionInfo.sParam3, 0));
                sMagicName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                cMethod = QuestConditionInfo.sParam2[0].ToString();
                if ((nLevel < 0) || (sMagicName == "") && (cMethod == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSKILLLEVEL);
                    return result;
                }
                if ((QuestConditionInfo.sParam4).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        UserMagic = ((TPlayObject)(PlayObject.m_MyHero)).GetMagicInfo(sMagicName);
                        if (UserMagic != null)
                        {
                            switch (cMethod)
                            {
                                case "=":
                                    if (UserMagic->btLevel == nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                case ">":
                                    if (UserMagic->btLevel > nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                case "<":
                                    if (UserMagic->btLevel < nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                default:
                                    if (UserMagic->btLevel >= nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                        }
                    }
                }
                else
                {
                    UserMagic = PlayObject.GetMagicInfo(sMagicName);
                    if (UserMagic != null)
                    {
                        switch (cMethod)
                        {
                            case "=":
                                if (UserMagic->btLevel == nLevel)
                                {
                                    result = true;
                                }
                                break;
                            case ">":
                                if (UserMagic->btLevel > nLevel)
                                {
                                    result = true;
                                }
                                break;
                            case "<":
                                if (UserMagic->btLevel < nLevel)
                                {
                                    result = true;
                                }
                                break;
                            default:
                                if (UserMagic->btLevel >= nLevel)
                                {
                                    result = true;
                                }
                                break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKSKILLLEVEL");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查地图指定坐标指定名称怪物数量
        /// CHECKMAPMOBCOUNT 地图 X Y 怪名 ><= 数量 范围
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKMAPMOBCOUNT(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nCount;
            int MonCount;
            TEnvirnoment Envir;
            string sMap;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nCount = HUtil32.Str_ToInt(QuestConditionInfo.sParam6, -1);// 数量
                sMap = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 地图ID 支持变量
                Envir = M2Share.g_MapManager.FindMap(sMap);
                MonCount = UserEngine.GetMapMonsterCount(Envir, QuestConditionInfo.nParam2, QuestConditionInfo.nParam3, QuestConditionInfo.nParam7, QuestConditionInfo.sParam4.Trim());
                cMethod = QuestConditionInfo.sParam5[0];
                switch (cMethod)
                {
                    case '=':
                        // 比较怪物数量
                        if (MonCount == nCount)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (MonCount > nCount)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (MonCount < nCount)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (MonCount >= nCount)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKMAPMOBCOUNT");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查人物周围自己宝宝数量
        /// 格式：CHECKSIDESLAVENAME 怪物名称(*代表所有) 范围 (>,<,=) 数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKSIDESLAVENAME(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMonName;
            char cMethod;
            int nCount;
            int nRange;
            int slavCount;
            List<TBaseObject> MonList;
            TBaseObject MoveMon;
            TBaseObject Slave;
            bool boAllSlave;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                boAllSlave = false;
                slavCount = 0;
                sMonName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 怪物名称
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);// 范围 支持变量
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);// 数量 支持变量
                cMethod = QuestConditionInfo.sParam3[0];// 操作符
                if (sMonName == "*")
                {
                    boAllSlave = true;
                }
                MonList = new List<TBaseObject>();
                try
                {
                    UserEngine.GetMapRangeMonster(PlayObject.m_PEnvir, PlayObject.m_nCurrX, PlayObject.m_nCurrY, nRange, MonList);// 查指定XY范围内的怪
                    if (MonList.Count > 0)
                    {
                        for (int I = 0; I < MonList.Count; I++)
                        {
                            MoveMon = MonList[I];
                            if (PlayObject.m_SlaveList.Count > 0)
                            {
                                for (int K = 0; K < PlayObject.m_SlaveList.Count; K++)
                                {
                                    Slave = PlayObject.m_SlaveList[K];
                                    if ((Slave != null))
                                    {
                                        if (!boAllSlave)
                                        {
                                            if (((Slave.m_sCharName).ToLower().CompareTo((sMonName).ToLower()) == 0) && (Slave == MoveMon))
                                            {
                                                slavCount++;
                                            }
                                        }
                                        else if ((Slave == MoveMon))
                                        {
                                            slavCount++;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                finally
                {
                    Dispose(MonList);
                }
                switch (cMethod)
                {
                    case '=':
                        // 比较怪物数量
                        if (slavCount == nCount)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (slavCount > nCount)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (slavCount < nCount)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (slavCount >= nCount)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKSIDESLAVENAME");
            }
            return result;
        }

        /// <summary>
        /// 功能:检测当前日期是否小于大于等于指定的日期,检测后日期差存放在人物的M0中  
        /// 格式：CHECKCURRENTDATE ><= 日期
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKCURRENTDATE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;// 操作符
            string sDate;// 指定的日期
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                sDate = QuestConditionInfo.sParam2;// 指定的日期
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        // 比较指定日期写当前日期
                        if (Convert.ToInt64(DateTime.Today) == Convert.ToInt64(Convert.ToDateTime(sDate)))
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (DateTime.Today > Convert.ToDateTime(sDate))
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (DateTime.Today < Convert.ToDateTime(sDate))
                        {
                            result = true;
                        }
                        break;
                }
                if (DateTime.Today < Convert.ToDateTime(sDate))
                {
                    PlayObject.m_nMval[0] = Convert.ToInt32(DateTime.Today - Convert.ToDateTime(sDate));
                }
                else if (DateTime.Today > Convert.ToDateTime(sDate))
                {
                    // 负数
                    PlayObject.m_nMval[0] = -Convert.ToInt32(DateTime.Today - Convert.ToDateTime(sDate));
                }
                else if (Convert.ToInt64(DateTime.Today) == Convert.ToInt64(Convert.ToDateTime(sDate)))
                {
                    PlayObject.m_nMval[0] = 0;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKCURRENTDATE");
            }
            return result;
        }

        /// <summary>
        /// 检查是否在攻城期间
        /// 格式:CHECKCASTLEWAR 城堡名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKCASTLEWAR(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TUserCastle Castle;
            string CastleName;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                CastleName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 城堡名称 支持变量
                Castle = M2Share.g_CastleManager.Find(CastleName);
                if (Castle != null)
                {
                    if (Castle.m_boUnderWar)
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKCASTLEWAR");
            }
            return result;
        }
    
        /// <summary>
        /// 检测师傅（或徒弟）是否在线
        /// 格式:CHECKMASTERONLINE
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKMASTERONLINE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TPlayObject m_MasterHuman;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_boMaster)// 有徒弟
                {
                    m_MasterHuman = UserEngine.GetMasterObject(PlayObject.m_sCharName);
                    if (m_MasterHuman != null)
                    {
                        result = true;
                    }
                }
                else if (PlayObject.m_sMasterName != "")
                {
                    m_MasterHuman = UserEngine.GetPlayObject(PlayObject.m_sMasterName);
                    if (m_MasterHuman != null)
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKMASTERONLINE");
            }
            return result;
        }

        /// <summary>
        /// 检测夫妻一方是否在线
        /// 格式:CHECKDEARONLINE
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKDEARONLINE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_DearHuman != null)
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKDEARONLINE");
            }
            return result;
        }

        /// <summary>
        /// 检测师傅(或徒弟)是否在XXX地图,支持SELF(是否同一地图) 
        /// 格式:CHECKMASTERONMAP XXX
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKMASTERONMAP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TPlayObject m_MasterHuman;
            string sMapName;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("Self").ToLower()) == 0)
                {
                    sMapName = PlayObject.m_sMapName;
                }
                else
                {
                    sMapName = QuestConditionInfo.sParam1;
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sMapName);
                }
                if (PlayObject.m_boMaster)// 有徒弟
                {
                    m_MasterHuman = UserEngine.GetMasterObject(PlayObject.m_sCharName);
                    if ((m_MasterHuman != null) && ((m_MasterHuman.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) == 0))
                    {
                        result = true;
                    }
                }
                else if (PlayObject.m_sMasterName != "")
                {
                    m_MasterHuman = UserEngine.GetPlayObject(PlayObject.m_sMasterName);
                    if ((m_MasterHuman != null) && ((m_MasterHuman.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) == 0))
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKMASTERONMAP");
            }
            return result;
        }

        /// <summary>
        /// 检测夫妻一方是否在XXX地图,支持SELF(是否同一地图)
        /// 格式:CHECKDEARONMAP XXX
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKDEARONMAP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMapName;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("Self").ToLower()) == 0)
                {
                    sMapName = PlayObject.m_sMapName;
                }
                else
                {
                    sMapName = QuestConditionInfo.sParam1;
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref sMapName);
                }
                if ((PlayObject.m_DearHuman != null) && ((PlayObject.m_DearHuman.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) == 0))
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKDEARONMAP");
            }
            return result;
        }

        /// <summary>
        /// 检测对面是否为自己的徒弟
        /// 格式:CHECKPOSEISPRENTICE
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKPOSEISPRENTICE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TBaseObject BaseObject;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                BaseObject = this.GetPoseCreate();// 判断面对面是否有人物
                if (BaseObject != null)
                {
                    if (((TPlayObject)(BaseObject)).m_boMaster)  // 有徒弟
                    {
                        if ((((TPlayObject)(BaseObject)).m_sMasterName).ToLower().CompareTo((PlayObject.m_sCharName).ToLower()) == 0)
                        {
                            result = true;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKPOSEISPRENTICE");
            }
            return result;
        }

        /// <summary>
        /// 脚本命令 FINDMAPPATH 地图 起步X 起步Y 终点X 终点Y (只要使用一次既可)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfFINDMAPPATH(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMap;
            int nX;
            int nY;
            int nXX;
            int nYY;
            TEnvirnoment Envir;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                sMap = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 地图支持变量
                nX = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);// 起步X
                nY = HUtil32.Str_ToInt(QuestConditionInfo.sParam3, -1);// 起步Y
                nXX = HUtil32.Str_ToInt(QuestConditionInfo.sParam4, -1);// 终点X
                nYY = HUtil32.Str_ToInt(QuestConditionInfo.sParam5, -1);// 终点Y
                if (sMap == "")
                {
                    return result;
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);// 查找地图
                if (Envir != null)
                {
                    UserEngine.m_nCurrX_136 = nX;
                    UserEngine.m_nCurrY_136 = nY;
                    UserEngine.m_NewCurrX_136 = nXX;
                    UserEngine.m_NewCurrY_136 = nYY;
                    PlayObject.m_sMapName136 = sMap;// 魔王岭地图名称
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfFINDMAPPATH");
            }
            return result;
        }

        /// <summary>
        /// 检测英雄的忠诚度
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKHEROLOYAL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nLoyal;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_MyHero == null)
                {
                    return result;
                }
                nLoyal = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, -1);
                if (nLoyal < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLoyal))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROLOYAL);
                        return result;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        if (((THeroObject)(PlayObject.m_MyHero)).m_nLoyal == nLoyal)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (((THeroObject)(PlayObject.m_MyHero)).m_nLoyal > nLoyal)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (((THeroObject)(PlayObject.m_MyHero)).m_nLoyal < nLoyal)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (((THeroObject)(PlayObject.m_MyHero)).m_nLoyal >= nLoyal)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKHEROLOYAL");
            }
            return result;
        }

        /// <summary>
        /// 判断是否在酿哪种酒
        /// 格式:ISONMAKEWINE X(1,2)  X-1普通酒 2-药酒
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfISONMAKEWINE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            byte nMakeWineType;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nMakeWineType = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), 0);
                if (!new ArrayList(new int[] { 1, 2 }).Contains(nMakeWineType))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sISONMAKEWINE);
                    return result;
                }
                if (PlayObject.m_boMakeWine)// 在NPC处正在酿酒
                {
                    if (PlayObject.n_MakeWineType == nMakeWineType)
                    {
                        result = true; // 酒的类型一致
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfISONMAKEWINE");
            }
            return result;
        }

        /// <summary>
        /// 功能:判断是否开启行会泉水仓库
        /// 格式:CHECKGUILDFOUNTAIN
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKGUILDFOUNTAIN(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_MyGuild != null)
                {
                    if (PlayObject.m_MyGuild.boGuildFountainOpen)
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKGUILDFOUNTAIN");
            }
            return result;
        }

        /// <summary>
        /// 功能:检测指定人物是否在指定地图范围之内
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckHumInRange(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMapName;
            int nX;
            int nY;
            int nRange;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (!(QuestConditionInfo.sParam2 == "self"))// 不大明，可能有问题
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1));
                }
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam4), -1);
                nRange = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam5), -1);
                if (nX < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nX);// 增加变量支持
                }
                if (nY < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nY);// 增加变量支持
                }
                if (nRange < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam4, ref nRange);// 增加变量支持
                }
                if ((sMapName == "") || (nX < 0) || (nY < 0) || (nRange < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKINMAPRANGE);
                    return result;
                }
                if ((PlayObject.m_sMapName).ToLower().CompareTo((sMapName).ToLower()) != 0)
                {
                    return result;
                }
                if ((Math.Abs(PlayObject.m_nCurrX - nX) <= nRange) && (Math.Abs(PlayObject.m_nCurrY - nY) <= nRange))
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckInMapRange");
            }
            return result;
        }

        /// <summary>
        ///  功能:检测当前地图中的人物是否属于同一个行会(所有人是同一行会才为真)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfMAPHUMISSAMEGUILD(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMapName;
            string Guildname;
            TGUild Guild;
            TPlayObject sPlayObject;
            List<TPlayObject> Playobjectlist;
            try
            {
                result = true;
                sMapName = QuestConditionInfo.sParam1.Trim();
                Guildname = QuestConditionInfo.sParam2.Trim();
                if (Guildname == "")
                {
                    Guild = PlayObject.m_MyGuild;
                    Guildname = Guild.sGuildName;
                }
                Playobjectlist = new List<TPlayObject>();
                UserEngine.GetMapRageHuman(M2Share.g_MapManager.FindMap(sMapName), 1000, 1000, 1000, Playobjectlist);
                for (int i = 0; i < Playobjectlist.Count; i++)
                {
                    sPlayObject = Playobjectlist[i];
                    Guild = sPlayObject.m_MyGuild;
                    if (!((Guildname).ToLower().CompareTo((Guild.sGuildName).ToLower()) == 0))
                    {
                        result = false;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfMAPHUMISSAMEGUILD");
            }
            return result;
        }

        private bool ConditionOfCheckIsAttackAllyGuild(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (this.m_Castle == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ISATTACKALLYGUILD);
                    return result;
                }
                if (PlayObject.m_MyGuild == null)
                {
                    return result;
                }
                result = this.m_Castle.IsAttackAllyGuild(PlayObject.m_MyGuild);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckIsAttackAllyGuild");
            }
            return result;
        }

        /// <summary>
        /// 检查人物技能
        /// 功能：检查英雄技能
        /// HEROCHECKSKILL 技能名称 控制符(=,>,<)  修炼等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfHEROCHECKSKILL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nSkillLevel;
            char cMethod;
            TUserMagic* UserMagic;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nSkillLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);
                if (nSkillLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nSkillLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sHEROCHECKSKILL);
                        return result;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sHEROCHECKSKILL);
                    return result;
                }
                if (PlayObject.m_MyHero != null)
                {
                    UserMagic = null;
                    UserMagic = ((TPlayObject)(PlayObject.m_MyHero)).GetMagicInfo(QuestConditionInfo.sParam1);
                    if (UserMagic == null)
                    {
                        return result;
                    }
                    cMethod = QuestConditionInfo.sParam2[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (UserMagic->btLevel == nSkillLevel)
                            {
                                result = true;
                            }
                            break;
                        case '>':
                            if (UserMagic->btLevel > nSkillLevel)
                            {
                                result = true;
                            }
                            break;
                        case '<':
                            if (UserMagic->btLevel < nSkillLevel)
                            {
                                result = true;
                            }
                            break;
                        default:
                            if (UserMagic->btLevel >= nSkillLevel)
                            {
                                result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfHEROCHECKSKILL");
            }
            return result;
        }

        private bool ConditionOfCheckStationTime(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nCount;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nCount))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKSTATIONTIME);
                        return result;
                    }
                }
                nCount = nCount * 60000;// 60 * 1000
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (HUtil32.GetTickCount() - PlayObject.m_dwStationTick == nCount)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (HUtil32.GetTickCount() - PlayObject.m_dwStationTick > nCount)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (HUtil32.GetTickCount() - PlayObject.m_dwStationTick < nCount)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (HUtil32.GetTickCount() - PlayObject.m_dwStationTick >= nCount)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckStationTime");
            }
            return result;
        }

        /// <summary>
        /// 判断是否有英雄
        /// 格式:HAVEHERO TRUE 带TRUE参数代码,判断是否有卧龙英雄,不带表示判断是否有白日门英雄
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckHasHero(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("TRUE").ToLower()) == 0)// 是否有卧龙英雄
                {
                    if (PlayObject.m_boHasHeroTwo && (PlayObject.m_sHeroCharName != ""))
                    {
                        result = true;
                    }
                }
                else
                {
                    if (PlayObject.m_boHasHero && (PlayObject.m_sHeroCharName != ""))// 是否有白日门英雄
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHasHero");
            }
            return result;
        }

        /// <summary>
        /// 检查英雄是否在线
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckHeroOnline(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = PlayObject.m_MyHero != null;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHeroOnline");
            }
            return result;
        }

        /// <summary>
        /// 检查英雄的等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckHeroLevel(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nHeroLevel;
            int nLevel;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROLEVEL);
                    return result;
                }
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nLevel))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROLEVEL);
                        return result;
                    }
                }
                if (PlayObject.m_MyHero != null)
                {
                    nHeroLevel = PlayObject.m_MyHero.m_Abil.Level;
                    cMethod = QuestConditionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (nHeroLevel == nLevel)
                            {
                                result = true;
                            }
                            break;
                        case '>':
                            if (nHeroLevel > nLevel)
                            {
                                result = true;
                            }
                            break;
                        case '<':
                            if (nHeroLevel < nLevel)
                            {
                                result = true;
                            }
                            break;
                        default:
                            if (nHeroLevel >= nLevel)
                            {
                                result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHeroLevel");
            }
            return result;
        }

        /// <summary>
        /// 检测矿纯度
        /// 命令格式:CHECKMINE 矿名称 数量 纯度
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCHECKMINE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMineName;
            int nMineCount;
            int nDura;
            int nCount;
            int I;
            TUserItem* UserItem;
            TStdItem* StdItem;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nCount = 0;
                sMineName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 矿石名
                nMineCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);// 数量
                nDura = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);// 纯度
                if (nMineCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nMineCount))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMINE);
                        return result;
                    }
                }
                if (nDura < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nDura))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMINE);
                        return result;
                    }
                }
                if ((sMineName == "") || (nMineCount < 0) || (nDura < 0) || (nDura > 100))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMINE);
                    return result;
                }
                if (PlayObject.m_ItemList.Count > 0)
                {
                    for (I = 0; I < PlayObject.m_ItemList.Count; I++)
                    {
                        UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                        if (UserItem != null)
                        {
                            StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                            if ((StdItem != null))
                            {
                                if ((StdItem->StdMode == 43) && ((HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen)).ToLower().CompareTo((sMineName).ToLower()) == 0))
                                {
                                    if (UserItem->Dura >= nDura * 1000)
                                    {
                                        nCount++;
                                    }
                                    if (nCount >= nMineCount)
                                    {
                                        result = true;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKMINE");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查在线人数
        /// 格式:CHECKONLINEPLAYCOUNT 操作符(<,>,=) 人数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKOnlinePlayCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nCount;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if ((nCount < 0))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKONLINEPLAYCOUNT);
                    return result;
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod) // 操作符
                {
                    case '=':
                        if (UserEngine.PlayObjectCount == nCount)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (UserEngine.PlayObjectCount > nCount)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (UserEngine.PlayObjectCount < nCount)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (UserEngine.PlayObjectCount >= nCount)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKOnlinePlayCount");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查死的玩家(或杀死玩家)等级
        /// 格式:CHECKPLAYDIELVL 操作符(<,>,=) 等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckPlaylvl(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char cMethod;
            int nCount;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), 0);
                if (PlayObject.m_LastHiter != null)
                {
                    if (PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT)
                    {
                        cMethod = QuestConditionInfo.sParam1[0];
                        switch (cMethod) // 操作符
                        {
                            case '=':
                                if (PlayObject.m_LastHiter.m_WAbil.Level == nCount)
                                {
                                    result = true;
                                }
                                break;
                            case '>':
                                if (PlayObject.m_LastHiter.m_WAbil.Level > nCount)
                                {
                                    result = true;
                                }
                                break;
                            case '<':
                                if (PlayObject.m_LastHiter.m_WAbil.Level < nCount)
                                {
                                    result = true;
                                }
                                break;
                            default:
                                if (PlayObject.m_LastHiter.m_WAbil.Level >= nCount)
                                {
                                    result = true;
                                }
                                break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPlaylvl");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查死的玩家(或杀死玩家)职业
        /// 格式:CHECKPLAYDIEJOB WARRIOR/WIZARD/TAOIST/ASSASSIN
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckPlayJob(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sParam1 = string.Empty;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_LastHiter != null)
                {
                    if (PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT)
                    {
                        sParam1 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                        switch (PlayObject.m_LastHiter.m_btJob)
                        {
                            case 0:
                                if ((sParam1).ToLower().CompareTo(("WARRIOR").ToLower()) == 0)
                                {
                                    result = true;
                                }
                                break;
                            case 1:
                                if ((sParam1).ToLower().CompareTo(("WIZARD").ToLower()) == 0)
                                {
                                    result = true;
                                }
                                break;
                            case 2:
                                if ((sParam1).ToLower().CompareTo(("TAOIST").ToLower()) == 0)
                                {
                                    result = true;
                                }
                                break;
                            default:
                                result = false;
                                break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPlayJob");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查死的玩家(或杀死玩家)性别
        /// 格式:CHECKKILLPLAYSEX MAN/WOMAN
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckPlaySex(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sParam1 = string.Empty;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_LastHiter != null)
                {
                    if (PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT)
                    {
                        sParam1 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                        switch (PlayObject.m_LastHiter.m_btGender)
                        {
                            case 0:
                                if ((sParam1).ToLower().CompareTo(("MAN").ToLower()) == 0)
                                {
                                    result = true;
                                }
                                break;
                            case 1:
                                if ((sParam1).ToLower().CompareTo(("WOMAN").ToLower()) == 0)
                                {
                                    result = true;
                                }
                                break;
                            default:
                                result = false;
                                break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPlaySex");
            }
            return result;
        }
        
        /// <summary>
        /// 功能：检查装备升级次数。
        /// 格式：CHECKITEMLEVEL 物品位置(0-13) (符号 < > =) 值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCHECKITEMLEVEL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nWhere;
            int nPoint;
            TUserItem* UserItem;
            char cMethod;
            try
            {
                result = false;
                nWhere = HUtil32.Str_ToInt(QuestConditionInfo.sParam1, -1);// 物品位置
                nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam3, -1);// 值
                if ((nWhere < 0) || (nWhere > m_UseItems.GetUpperBound(0)) || (nPoint < 0) || (nPoint > 255))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKITEMLEVEL);
                    return result;
                }
                UserItem = PlayObject.m_UseItems[nWhere];
                if (UserItem->wIndex <= 0)
                {
                    return result;
                }
                cMethod = QuestConditionInfo.sParam2[0];
                switch (cMethod)// 操作符
                {
                    case '=':
                        if (UserItem->btValue[9] == nPoint)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (UserItem->btValue[9] > nPoint)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (UserItem->btValue[9] < nPoint)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (UserItem->btValue[9] >= nPoint)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKITEMLEVEL");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查酒的品质 
        /// 格式:CHECKMAKEWINE 酒名称 操作符(<,>,=) 品质(0-10)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCheckMakeWine(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sItmeName;
            int nDura;
            TUserItem* UserItem;
            TStdItem* StdItem;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                sItmeName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 酒名称
                nDura = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam3), -1);// 酒品质
                if (nDura < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam3, ref nDura))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMAKEWINE);
                        return result;
                    }
                }
                if ((sItmeName == "") || (nDura < 0) || (nDura > 10))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKMAKEWINE);
                    return result;
                }
                cMethod = QuestConditionInfo.sParam2[0];// 操作符
                if (PlayObject.m_ItemList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_ItemList.Count; I++)
                    {
                        UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                        StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                        if ((StdItem != null) && (StdItem->StdMode == 60) && (StdItem->Shape != 0) && string.Compare(HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), sItmeName, true) == 0)
                        {
                            switch (cMethod)
                            {
                                case '=':
                                    if (UserItem->btValue[0] == nDura)
                                    {
                                        result = true;
                                    }
                                    break;
                                case '>':
                                    if (UserItem->btValue[0] > nDura)
                                    {
                                        result = true;
                                    }
                                    break;
                                case '<':
                                    if (UserItem->btValue[0] < nDura)
                                    {
                                        result = true;
                                    }
                                    break;
                                default:
                                    if (UserItem->btValue[0] >= nDura)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                            if (result)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKMAKEWINE");
            }
            return result;
        }


        /// <summary>
        /// 功能:检测英雄PK值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKHEROPKPOINT(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int n_mHEROPKPOINT;
            int nHEROPKPOINT;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROPKPOINT);
                    return result;
                }
                nHEROPKPOINT = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nHEROPKPOINT < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nHEROPKPOINT))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROPKPOINT);
                        return result;
                    }
                }
                if (PlayObject.m_MyHero != null)
                {
                    n_mHEROPKPOINT = PlayObject.m_MyHero.m_nPkPoint;
                    cMethod = QuestConditionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (n_mHEROPKPOINT == nHEROPKPOINT)
                            {
                                result = true;
                            }
                            break;
                        case '>':
                            if (n_mHEROPKPOINT > nHEROPKPOINT)
                            {
                                result = true;
                            }
                            break;
                        case '<':
                            if (n_mHEROPKPOINT < nHEROPKPOINT)
                            {
                                result = true;
                            }
                            break;
                        default:
                            if (n_mHEROPKPOINT >= nHEROPKPOINT)
                            {
                                result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKHEROPKPOINT");
            }
            return result;
        }

        /// <summary>
        /// 功能：检测文本里的编码是否存在
        /// 格式：CHECKCODELIST 玩家变量 文件路径
        /// 例子: CHECKCODELIST <$STR(S1)> ..\questdiary\冲值\500元卡号.txt
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKCODELIST(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            TStringList LoadList = null;
            string sPlayID;
            string sLine;
            string sFileName;
            try
            {
                result = false;
                try
                {
                    sPlayID = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 用户的变量,即输入的字符
                    LoadList = new TStringList();
                    sFileName = QuestConditionInfo.sParam2;// 文本路径
                    if (sFileName[0] == '\\')
                    {
                        sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
                    }
                    if (sFileName[1] == '\\')
                    {
                        sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
                    }
                    if (sFileName[2] == '\\')
                    {
                        sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
                    }
                    sFileName = M2Share.g_Config.sEnvirDir + sFileName;
                    if (File.Exists(sFileName))
                    {

                        LoadList.LoadFromFile(sFileName);
                        if (LoadList.Count > 0)
                        {
                            for (int I = 0; I < LoadList.Count; I++)
                            {
                                sLine = LoadList[I].Trim();
                                if ((sLine == "") || (sLine[0] == ';'))
                                {
                                    continue;
                                }
                                if ((sLine).ToLower().CompareTo((sPlayID).ToLower()) == 0)
                                {
                                    result = true;
                                    break;
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKCODELIST);
                    }
                }
                finally
                {
                    Dispose(LoadList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKCODELIST");
            }
            return result;
        }

        /// <summary>
        /// 功能：检测行会成员上限
        /// 格式：CHECKGUILDMEMBERCOUNT <,>,= 人数(65535)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKGUILDMEMBERCOUNT(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            ushort nMemberCount;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_MyGuild != null)
                {
                    nMemberCount = (ushort)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), 0);
                    cMethod = QuestConditionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount == nMemberCount)
                            {
                                result = true;
                            }
                            break;
                        case '>':
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount > nMemberCount)
                            {
                                result = true;
                            }
                            break;
                        case '<':
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount < nMemberCount)
                            {
                                result = true;
                            }
                            break;
                        default:
                            if (PlayObject.m_MyGuild.m_nGuildMemberCount >= nMemberCount)
                            {
                                result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKGUILDMEMBERCOUNT");
            }
            return result;
        }

        /// <summary>
        /// 功能：检测行会酒泉数
        /// 格式：CHECKGUILDFOUNTAINVALUE <,>,= 点数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKGUILDFOUNTAINValue(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nPoint;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (PlayObject.m_MyGuild != null)
                {
                    nPoint = HUtil32.Str_ToInt(QuestConditionInfo.sParam2, 0);
                    cMethod = QuestConditionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (PlayObject.m_MyGuild.m_nGuildFountain == nPoint)
                            {
                                result = true;
                            }
                            break;
                        case '>':
                            if (PlayObject.m_MyGuild.m_nGuildFountain > nPoint)
                            {
                                result = true;
                            }
                            break;
                        case '<':
                            if (PlayObject.m_MyGuild.m_nGuildFountain < nPoint)
                            {
                                result = true;
                            }
                            break;
                        default:
                            if (PlayObject.m_MyGuild.m_nGuildFountain >= nPoint)
                            {
                                result = true;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKGUILDFOUNTAINValue");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查角色内功等级
        /// 格式:CHECKNGLEVEL 操作符(<,>,=) 等级数(1-255) Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHECKNGLEVEL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            byte nLevel;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nLevel = (byte)HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), 0);
                if ((nLevel <= 0) || (nLevel > 255))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKNGLEVEL);
                    return result;
                }
                cMethod = QuestConditionInfo.sParam1[0];
                if ((QuestConditionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                        {
                            switch (cMethod)
                            {
                                case '=':
                                    if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel == nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                case '>':
                                    if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel > nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                case '<':
                                    if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel < nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                                default:
                                    if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= nLevel)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                        }
                    }
                }
                else
                {
                    if (PlayObject.m_boTrainingNG)
                    {
                        switch (cMethod)
                        {
                            case '=':
                                if (PlayObject.m_NGLevel == nLevel)
                                {
                                    result = true;
                                }
                                break;
                            case '>':
                                if (PlayObject.m_NGLevel > nLevel)
                                {
                                    result = true;
                                }
                                break;
                            case '<':
                                if (PlayObject.m_NGLevel < nLevel)
                                {
                                    result = true;
                                }
                                break;
                            default:
                                if (PlayObject.m_NGLevel >= nLevel)
                                {
                                    result = true;
                                }
                                break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKNGLEVEL");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查指定装备位置是否带有指定的物品
        /// 格式:CHECKITEMSNAME 位置(0-13) 物品名称
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCHECKITEMSNAME(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int n1;
            string sName = string.Empty;
            TUserItem* UserItem;
            TStdItem* StdItem;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                n1 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), -1);// 位置
                sName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);// 物品名字
                if ((!(n1 >= 0 && n1 <= 13)) || (sName == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKITEMSNAME);
                    return result;
                }
                UserItem = PlayObject.m_UseItems[n1];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    //PlayObject.SysMsg('你身上没有戴指定物品！！！', c_Red, t_Hint);
                    return result;
                }
                if (string.Compare(HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), sName, true) == 0)
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKITEMSNAME");
            }
            return result;
        }

        /// <summary>
        /// 功能：检查装备绑定状态 
        /// 格式：CHECKITEMSTATE 装备位置(0-13) 项目(0-5)
        /// 项目: 0 禁止扔1 禁止交易 2 禁止存 3 禁止修 4 禁止出售 5 禁止爆出
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private unsafe bool ConditionOfCHECKITEMSTATE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int n1;
            int n2;
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                n1 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam1), -1);
                n2 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (n1 < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam1, ref n1);
                }
                if (n2 < 0)
                {
                    GetValValue(PlayObject, QuestConditionInfo.sParam2, ref n2);
                }
                if ((!(n1 >= 0 && n1 <= 13)) || (!(n2 >= 0 && n2 <= 5)))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sCHECKITEMSTATE);
                    return result;
                }
                UserItem = PlayObject.m_UseItems[n1];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    // PlayObject.SysMsg('你身上没有戴指定物品！！！', c_Red, t_Hint);
                    return result;
                }
                switch (n2)// 项目
                {
                    case 0:
                        if (UserItem->btValue[14] == 1)
                        {
                            result = true;
                        }
                        break;
                    case 1:
                        if (UserItem->btValue[15] == 1)
                        {
                            result = true;
                        }
                        break;
                    case 2:
                        if (UserItem->btValue[16] == 1)
                        {
                            result = true;
                        }
                        break;
                    case 3:
                        if (UserItem->btValue[17] == 1)
                        {
                            result = true;
                        }
                        break;
                    case 4:
                        if (UserItem->btValue[18] == 1)
                        {
                            result = true;
                        }
                        break;
                    case 5:
                        if (UserItem->btValue[19] == 1)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKITEMSTATE");
            }
            return result;
        }

        /// <summary>
        /// 功能：检测服务器最高属性人物命令  
        /// 格式：ISHIGH 项目(L P D M S)
        /// 项目: L--等级  P--PK值  D--攻击力  M--魔法力  S--道术
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfISHIGH(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string str;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                str = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);
                if ((str == "") || (str.Length > 2))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sISHIGH);
                    return result;
                }
                if (PlayObject.m_btPermission < 6)// 人物权限小于6
                {
                    if ((str).ToLower().CompareTo(("L").ToLower()) == 0)// 检查等级
                    {
                        if (M2Share.g_HighLevelHuman != null)
                        {
                            if (PlayObject.m_Abil.Level > ((TPlayObject)(M2Share.g_HighLevelHuman)).m_Abil.Level)
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                    else if ((str).ToLower().CompareTo(("P").ToLower()) == 0)// 检查PK值
                    {
                        if (M2Share.g_HighPKPointHuman != null)
                        {
                            if (PlayObject.m_nPkPoint > ((TPlayObject)(M2Share.g_HighPKPointHuman)).m_nPkPoint)
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                    else if ((str).ToLower().CompareTo(("D").ToLower()) == 0) // 检查攻击力
                    {
                        if (M2Share.g_HighDCHuman != null)
                        {
                            if (HUtil32.HiWord(PlayObject.m_WAbil.DC) > HUtil32.HiWord(((TPlayObject)(M2Share.g_HighDCHuman)).m_WAbil.DC))
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                    else if ((str).ToLower().CompareTo(("M").ToLower()) == 0) // 检查魔法力
                    {
                        if (M2Share.g_HighMCHuman != null)
                        {
                            if (HUtil32.HiWord(PlayObject.m_WAbil.MC) > HUtil32.HiWord(((TPlayObject)(M2Share.g_HighMCHuman)).m_WAbil.MC))
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                    else if ((str).ToLower().CompareTo(("S").ToLower()) == 0) // 检查道术
                    {
                        if (M2Share.g_HighSCHuman != null)
                        {
                            if (HUtil32.HiWord(PlayObject.m_WAbil.SC) > HUtil32.HiWord(((TPlayObject)(M2Share.g_HighSCHuman)).m_WAbil.SC))
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfISHIGH");
            }
            return result;
        }

        /// <summary>
        /// 检查英雄职业
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCheckHeroJob(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            byte btJob;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKHEROJOB);
                    return result;
                }
                if (PlayObject.m_MyHero != null)
                {
                    btJob = PlayObject.m_MyHero.m_btJob;
                    if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "WARRIOR", 3))
                    {
                        result = true;
                        if (btJob != 0)
                        {
                            result = false;
                        }
                    }
                    if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "WIZARD", 3))
                    {
                        result = true;
                        if (btJob != 1)
                        {
                            result = false;
                        }
                    }
                    if (HUtil32.CompareLStr(QuestConditionInfo.sParam1, "TAOIST", 3))
                    {
                        result = true;
                        if (btJob != 2)
                        {
                            result = false;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckHeroJob");
            }
            return result;
        }

        /// <summary>
        /// 功能:检查角色是否学过内功 
        /// 格式:CHANGREADNG Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfCHANGREADNG(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                        {
                            result = true;
                        }
                    }
                }
                else
                {
                    if (PlayObject.m_boTrainingNG)
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHANGREADNG");
            }
            return result;
        }

        private unsafe bool ConditionOfCHECKKIMNEEDLE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int ICount = 0;
            int iParam = 0;
            int iDura = 0;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if (QuestConditionInfo.nParam2 > 0)
                {
                    ICount = QuestConditionInfo.nParam2;
                    PlayObject.QuestCheckItem(QuestConditionInfo.sParam1, ref ICount, ref iParam, ref iDura);
                    if (ICount >= QuestConditionInfo.nParam2)
                    {
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKKIMNEEDLE");
            }
            return result;
        }

        private bool ConditionOfCHECKHUMANPULSE(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.nParam1 >= 0) && (QuestConditionInfo.nParam1 <= 3) && (QuestConditionInfo.nParam2 >= 0) && (QuestConditionInfo.nParam2 <= 5))
                {
                    if (QuestConditionInfo.nParam2 == 0)
                    {
                        result = true;
                    }
                    else
                    {
                        if ((QuestConditionInfo.sParam3).ToLower().CompareTo(("Hero").ToLower()) == 0)
                        {
                            if (PlayObject.m_MyHero != null)
                            {
                                if (((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[QuestConditionInfo.nParam1].Pulse >= QuestConditionInfo.nParam2 - 1)
                                {
                                    result = true;
                                }
                            }
                        }
                        else
                        {
                            if (PlayObject.m_HumPulses[QuestConditionInfo.nParam1].Pulse >= QuestConditionInfo.nParam2 - 1)
                            {
                                result = true;
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKHUMANPULSE");
            }
            return result;
        }

        private bool ConditionOfCHECKOPENPULSELEVEL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.sParam3).ToLower().CompareTo(("Hero").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        switch (QuestConditionInfo.nParam1)
                        {
                            case 0:
                                switch (QuestConditionInfo.nParam2)
                                {
                                    case 1:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel0)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 2:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel1)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 3:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel2)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 4:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel3)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 5:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel4)
                                        {
                                            result = true;
                                        }
                                        break;
                                }
                                break;
                            case 1:
                                switch (QuestConditionInfo.nParam2)
                                {
                                    case 1:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel5)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 2:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel6)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 3:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel7)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 4:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel8)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 5:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel9)
                                        {
                                            result = true;
                                        }
                                        break;
                                }
                                break;
                            case 2:
                                switch (QuestConditionInfo.nParam2)
                                {
                                    case 1:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel10)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 2:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel11)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 3:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel12)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 4:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel13)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 5:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel14)
                                        {
                                            result = true;
                                        }
                                        break;
                                }
                                break;
                            case 3:
                                switch (QuestConditionInfo.nParam2)
                                {
                                    case 1:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel15)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 2:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel16)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 3:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel17)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 4:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel18)
                                        {
                                            result = true;
                                        }
                                        break;
                                    case 5:
                                        if (((THeroObject)(PlayObject.m_MyHero)).m_NGLevel >= M2Share.g_Config.PulsePointNGLevel19)
                                        {
                                            result = true;
                                        }
                                        break;
                                }
                                break;
                        }
                    }
                }
                else
                {
                    switch (QuestConditionInfo.nParam1)
                    {
                        case 0:
                            switch (QuestConditionInfo.nParam2)
                            {
                                case 1:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel0)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 2:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel1)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 3:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel2)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 4:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel3)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 5:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel4)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                            break;
                        case 1:
                            switch (QuestConditionInfo.nParam2)
                            {
                                case 1:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel5)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 2:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel6)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 3:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel7)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 4:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel8)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 5:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel9)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                            break;
                        case 2:
                            switch (QuestConditionInfo.nParam2)
                            {
                                case 1:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel10)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 2:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel11)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 3:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel12)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 4:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel13)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 5:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel14)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                            break;
                        case 3:
                            switch (QuestConditionInfo.nParam2)
                            {
                                case 1:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel15)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 2:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel16)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 3:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel17)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 4:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel18)
                                    {
                                        result = true;
                                    }
                                    break;
                                case 5:
                                    if (PlayObject.m_NGLevel >= M2Share.g_Config.PulsePointNGLevel19)
                                    {
                                        result = true;
                                    }
                                    break;
                            }
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKOPENPULSELEVEL");
            }
            return result;
        }

        private bool ConditionOfCHECKPULSELEVEL(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                if ((QuestConditionInfo.nParam1 >= 0 && QuestConditionInfo.nParam1 <= 3) && (QuestConditionInfo.nParam2 >= 1 && QuestConditionInfo.nParam2 <= 5))
                {
                    if (PlayObject.m_HumPulses[QuestConditionInfo.nParam1].Pulse == QuestConditionInfo.nParam2 - 1)
                    {
                        result = true;
                    }
                    else if (PlayObject.m_HumPulses[QuestConditionInfo.nParam1].Pulse >= QuestConditionInfo.nParam2)
                    {
                        PlayObject.SendMsg(this, Grobal2.RM_OPENPULSE_OK, 1, 0, 0, 0, ""); // 错误参数1为 经络已经打通
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCHECKPULSELEVEL");
            }
            return result;
        }

        private bool GetValValue(TPlayObject PlayObject, string sMsg, ref int nValue)
        {
            bool result = false;
            int n01;
            try
            {
                result = false;
                if (sMsg == "")
                {
                    return result;
                }
                n01 = M2Share.GetValNameNo(sMsg);
                if (n01 >= 0)
                {
                    if (HUtil32.rangeInDefined(n01, 0, 99))
                    {
                        nValue = PlayObject.m_nVal[n01];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 100, 199))
                    {
                        nValue = M2Share.g_Config.GlobalVal[n01 - 100];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 200, 299))
                    {
                        nValue = PlayObject.m_DyVal[n01 - 200];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 300, 399))
                    {
                        nValue = PlayObject.m_nMval[n01 - 300];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 400, 499))
                    {
                        nValue = M2Share.g_Config.GlobaDyMval[n01 - 400];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 500, 599))
                    {
                        nValue = PlayObject.m_nInteger[n01 - 500];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 800, 1199))
                    {
                        nValue = M2Share.g_Config.GlobalVal[n01 - 700]; //G变量
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.GetValValue1");
            }
            return result;
        }

        private bool GetValValue(TPlayObject PlayObject, string sMsg, ref string sValue)
        {
            bool result = false;
            int n01;
            try
            {
                result = false;
                if (sMsg == "")
                {
                    return result;
                }
                n01 = M2Share.GetValNameNo(sMsg);
                if (n01 >= 0)
                {
                    if (HUtil32.rangeInDefined(n01, 600, 699))
                    {
                        sValue = PlayObject.m_sString[n01 - 600];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 700, 799))
                    {
                        sValue = M2Share.g_Config.GlobalAVal[n01 - 700];
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 1200, 1599))
                    {
                        sValue = M2Share.g_Config.GlobalAVal[n01 - 1100];// A变量(100-499)
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.GetValValue2");
            }
            return result;
        }

        private bool SetValValue(TPlayObject PlayObject, string sMsg, int nValue)
        {
            bool result = false;
            int n01;
            try
            {
                result = false;
                if (sMsg == "")
                {
                    return result;
                }
                n01 = M2Share.GetValNameNo(sMsg);
                if (n01 >= 0)
                {
                    if (HUtil32.rangeInDefined(n01, 0, 99))
                    {
                        PlayObject.m_nVal[n01] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 100, 199))
                    {
                        M2Share.g_Config.GlobalVal[n01 - 100] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 200, 299))
                    {
                        PlayObject.m_DyVal[n01 - 200] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 300, 399))
                    {
                        PlayObject.m_nMval[n01 - 300] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 400, 499))
                    {
                        M2Share.g_Config.GlobaDyMval[n01 - 400] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 500, 599))
                    {
                        PlayObject.m_nInteger[n01 - 500] = nValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 800, 1199))
                    {
                        M2Share.g_Config.GlobalVal[n01 - 700] = nValue;// G变量
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.SetValValue1");
            }
            return result;
        }

        private bool SetValValue(TPlayObject PlayObject, string sMsg, string sValue)
        {
            bool result = false;
            int n01;
            try
            {
                result = false;
                if (sMsg == "")
                {
                    return result;
                }
                n01 = M2Share.GetValNameNo(sMsg);
                if (n01 >= 0)
                {
                    if (HUtil32.rangeInDefined(n01, 600, 699))
                    {
                        PlayObject.m_sString[n01 - 600] = sValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 700, 799))
                    {
                        M2Share.g_Config.GlobalAVal[n01 - 700] = sValue;
                        result = true;
                    }
                    else if (HUtil32.rangeInDefined(n01, 1200, 1599))
                    {
                        M2Share.g_Config.GlobalAVal[n01 - 1100] = sValue;// A变量(100-499)
                        result = true;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.SetValValue2");
            }
            return result;
        }

        private void ActionOfAnsiReplaceText(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sValue1;
            string sValue2;
            string sValue3;
            int n01;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sValue1 = QuestActionInfo.sParam1;
                sValue2 = QuestActionInfo.sParam2;
                sValue3 = QuestActionInfo.sParam3;
                if ((sValue1 == "") || (sValue2 == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ANSIREPLACETEXT);
                    return;
                }
                GetValValue(PlayObject, QuestActionInfo.sParam2, ref sValue2);
                GetValValue(PlayObject, QuestActionInfo.sParam3, ref sValue3);
                n01 = M2Share.GetValNameNo(sValue1);
                if (n01 >= 0)
                {
                    if (HUtil32.rangeInDefined(n01, 600, 699))
                    {
                        sValue1 = PlayObject.m_sString[n01 - 600];
                        if ((sValue1.IndexOf(sValue2) != -1))
                        {
                            PlayObject.m_sString[n01 - 600] = sValue1.Replace(sValue2, sValue3);
                        }
                    }
                    else if (HUtil32.rangeInDefined(n01, 700, 799))
                    {
                        sValue1 = M2Share.g_Config.GlobalAVal[n01 - 700];
                        if ((sValue1.IndexOf(sValue2) != -1))
                        {
                            M2Share.g_Config.GlobalAVal[n01 - 700] = sValue1.Replace(sValue2, sValue3);
                        }
                    }
                    else if (HUtil32.rangeInDefined(n01, 1200, 1599))
                    {
                        sValue1 = M2Share.g_Config.GlobalAVal[n01 - 1100]; // A变量(100-499)
                        if ((sValue1.IndexOf(sValue2) != -1))
                        {
                            M2Share.g_Config.GlobalAVal[n01 - 1100] = sValue1.Replace(sValue2, sValue3);
                        }
                    }
                    else {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ANSIREPLACETEXT);
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ANSIREPLACETEXT);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfAnsiReplaceText");
            }
        }

        public unsafe bool ActionOfEncodeText_GetHumanInfoValue(TPlayObject PlayObject, string sVariable, ref string sValue)
        {
            bool result = false;
            string sMsg;
            string s10 = string.Empty;
            result = false;
            if (sVariable == "")
            {
                return result;
            }
            sMsg = sVariable;
            HUtil32.ArrestStringEx(sMsg, "<", ">", ref s10);
            if (s10 == "")
            {
                return result;
            }
            sVariable = s10;
            if (sVariable == "$USERNAME")// 个人信息
            {
                sValue = PlayObject.m_sCharName;
                result = true;
                return result;
            }
            if (sVariable == "$USERALLNAME") // 全名 
            {
                sValue = PlayObject.GetShowName();
                result = true;
                return result;
            }
            if (sVariable == "$SFNAME")// 师傅名 
            {
                sValue = PlayObject.m_sMasterName;
                result = true;
                return result;
            }
            if (sVariable == "$HERONAME") // 英雄名
            {
                if (PlayObject.m_MyHero != null)
                {
                    sValue = ((THeroObject)(PlayObject.m_MyHero)).m_sCharName;
                    result = true;
                    return result;
                }
            }
            if (sVariable == "$KILLER")// 杀人者变量
            {
                if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                {
                    if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                    {
                        sValue = PlayObject.m_LastHiter.m_sCharName;
                    }
                    else if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_HEROOBJECT))
                    {
                        if (PlayObject.m_LastHiter.m_Master != null)
                        {
                            sValue = PlayObject.m_LastHiter.m_Master.m_sCharName;
                        }
                        else
                        {
                            sValue = "未知";
                        }
                    }
                }
                else
                {
                    sValue = "未知";
                }
                result = true;
                return result;
            }
            if (sVariable == "$MONKILLER") // 杀人的怪物变量
            {
                if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                {
                    if ((PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_PLAYOBJECT) && (PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_HEROOBJECT))
                    {
                        sValue = PlayObject.m_LastHiter.m_sCharName;
                    }
                }
                else
                {
                    sValue = "未知";
                }
                result = true;
                return result;
            }
            if (sVariable == "$MAP")
            {
                sValue = PlayObject.m_PEnvir.sMapName;
                result = true;
                return result;
            }
            if (sVariable == "$GUILDNAME") // 行会名称
            {
                if (PlayObject.m_MyGuild != null)
                {
                    sValue = PlayObject.m_MyGuild.sGuildName;
                }
                else
                {
                    sValue = "";
                }
                result = true;
                return result;
            }
            if (sVariable == "$RANKNAME")
            {
                sValue = PlayObject.m_sGuildRankName;
                result = true;
                return result;
            }
            if (sVariable == "$DRESS")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$WEAPON")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$RIGHTHAND")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RIGHTHAND]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$HELMET")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$NECKLACE")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$RING_R")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$RING_L")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$ARMRING_R")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$ARMRING_L")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$BUJUK")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$BELT")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BELT]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$BOOTS")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$CHARM")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$ZHULI")// 斗笠
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex);
                result = true;
                return result;
            }
            else if (sVariable == "$IPADDR")
            {
                sValue = PlayObject.m_sIPaddr;
                result = true;
                return result;
            }
            else if (sVariable == "$IPLOCAL")
            {
                sValue = PlayObject.m_sIPLocal;
                // GetIPLocal(PlayObject.m_sIPaddr);
                result = true;
                return result;
            }
            return result;
        }

        public void ActionOfEncodeText_SetEncodeText(TPlayObject PlayObject, string sValName, string sValue, int n01, TQuestActionInfo QuestActionInfo)
        {
            n01 = M2Share.GetValNameNo(sValName);
            if (n01 >= 0)
            {
                if (HUtil32.rangeInDefined(n01, 600, 699))
                {
                    PlayObject.m_sString[n01 - 600] = sValue;
                }
                else if (HUtil32.rangeInDefined(n01, 700, 799))
                {
                    M2Share.g_Config.GlobalAVal[n01 - 700] = sValue;
                }
                else if (HUtil32.rangeInDefined(n01, 1200, 1599))
                {
                    M2Share.g_Config.GlobalAVal[n01 - 1100] = sValue; // A变量(100-499)
                }
                else {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ENCODETEXT);
                }
            }
            else
            {
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_ENCODETEXT);
            }
        }

        private void ActionOfEncodeText(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sNewValue = string.Empty;
            string sValue1 = string.Empty;
            string sValue2 = string.Empty;
            string sValue3 = string.Empty;
            string sValue4 = string.Empty;
            string sValue5 = string.Empty;
            string sValue6 = string.Empty;
            int n01 = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sValue1 = QuestActionInfo.sParam1;
                sValue2 = QuestActionInfo.sParam2;
                sValue3 = QuestActionInfo.sParam3;
                sValue4 = QuestActionInfo.sParam4;
                sValue5 = QuestActionInfo.sParam5;
                sValue6 = QuestActionInfo.sParam6;
                if ((sValue2 != "") && (sValue2[1] == '<') && (sValue2[sValue2.Length] == '>'))
                {
                    ActionOfEncodeText_GetHumanInfoValue(PlayObject, sValue2, ref sValue2);
                }
                else
                {
                    GetValValue(PlayObject, sValue2, ref sValue2);
                }
                if ((sValue3 != "") && (sValue3[1] == '<') && (sValue3[sValue3.Length] == '>'))
                {
                    ActionOfEncodeText_GetHumanInfoValue(PlayObject, sValue3, ref sValue3);
                }
                else
                {
                    GetValValue(PlayObject, sValue3, ref sValue3);
                }
                if ((sValue4 != "") && (sValue4[1] == '<') && (sValue4[sValue4.Length] == '>'))
                {
                    ActionOfEncodeText_GetHumanInfoValue(PlayObject, sValue4, ref sValue4);
                }
                else
                {
                    GetValValue(PlayObject, sValue4, ref sValue4);
                }
                if ((sValue5 != "") && (sValue5[1] == '<') && (sValue5[sValue5.Length] == '>'))
                {
                    ActionOfEncodeText_GetHumanInfoValue(PlayObject, sValue5, ref sValue5);
                }
                else
                {
                    GetValValue(PlayObject, sValue5, ref sValue5);
                }
                if ((sValue6 != "") && (sValue6[1] == '<') && (sValue6[sValue6.Length] == '>'))
                {
                    ActionOfEncodeText_GetHumanInfoValue(PlayObject, sValue6, ref sValue6);
                }
                else
                {
                    GetValValue(PlayObject, sValue6, ref sValue6);
                }
                sNewValue = sValue2 + sValue3 + sValue4 + sValue5 + sValue6;
                ActionOfEncodeText_SetEncodeText(PlayObject, sValue1, sNewValue, n01, QuestActionInfo);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfEncodeText");
            }
        }

        /// <summary>
        /// 功能:穿上物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfTakeOnItem(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nItemIdx;
            TUserItem* UserItem;
            TStdItem* StdItem;
            string sItemName;
            string sUserItemName;
            int nWhere;
            bool boFound;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItemName = QuestActionInfo.sParam1;
                nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((sItemName == "") || (!(nWhere >= m_UseItems.GetLowerBound(0) && nWhere <= m_UseItems.GetUpperBound(0))))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_TAKEONITEM);
                    return;
                }
                nItemIdx = -1;
                boFound = false;
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (PlayObject.m_MyHero.m_ItemList.Count > 0)
                        {
                            for (int I = 0; I < PlayObject.m_MyHero.m_ItemList.Count; I++)
                            {
                                UserItem = (TUserItem*)PlayObject.m_MyHero.m_ItemList[I];
                                if (UserItem != null)
                                {
                                    sUserItemName = "";  // 取自定义物品名称
                                    if (UserItem->btValue[13] == 1)
                                    {
                                        sUserItemName = ItemUnit.GetCustomItemName(UserItem->MakeIndex, UserItem->wIndex);
                                    }
                                    if (sUserItemName == "")
                                    {
                                        sUserItemName = UserEngine.GetStdItemName(UserItem->wIndex);
                                    }
                                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                    if (StdItem != null)
                                    {
                                        if ((sUserItemName).ToLower().CompareTo((sItemName).ToLower()) == 0)
                                        {
                                            boFound = true;
                                            nItemIdx = UserItem->MakeIndex;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                        if ((nItemIdx >= 0) && boFound)
                        {
                            PlayObject.ClientHeroTakeOnItems((byte)nWhere, nItemIdx, sItemName);
                            ((THeroObject)(PlayObject.m_MyHero)).SendUseitems();// 发送使用的物品
                            ((THeroObject)(PlayObject.m_MyHero)).ClientQueryBagItems();
                        }
                    }
                }
                else
                {
                    if (PlayObject.m_ItemList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_ItemList.Count; I++)
                        {
                            UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                            if (UserItem != null)
                            {
                                sUserItemName = "";// 取自定义物品名称
                                if (UserItem->btValue[13] == 1)
                                {
                                    sUserItemName = ItemUnit.GetCustomItemName(UserItem->MakeIndex, UserItem->wIndex);
                                }
                                if (sUserItemName == "")
                                {
                                    sUserItemName = UserEngine.GetStdItemName(UserItem->wIndex);
                                }
                                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                if (StdItem != null)
                                {
                                    if ((sUserItemName).ToLower().CompareTo((sItemName).ToLower()) == 0)
                                    {
                                        boFound = true;
                                        nItemIdx = UserItem->MakeIndex;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if ((nItemIdx >= 0) && boFound)
                    {
                        PlayObject.ClientTakeOnItems((byte)nWhere, nItemIdx, sItemName);
                        PlayObject.SendUseitems();// 发送使用的物品
                        PlayObject.ClientQueryBagItems();
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTakeOnItem");
            }
        }

        /// <summary>
        /// 功能:脱下装备
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfTakeOffItem(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nItemIdx;
            string sItemName;
            string sUserItemName;
            int nWhere;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItemName = QuestActionInfo.sParam1;
                nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((sItemName == "") || (!(nWhere >= m_UseItems.GetLowerBound(0) && nWhere <= m_UseItems.GetUpperBound(0))))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_TAKEONITEM);
                    return;
                }
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        if (PlayObject.m_MyHero.m_UseItems[nWhere]->wIndex > 0)
                        {
                            sUserItemName = "";
                            if (PlayObject.m_MyHero.m_UseItems[nWhere]->btValue[13] == 1)
                            {
                                sUserItemName = ItemUnit.GetCustomItemName(PlayObject.m_MyHero.m_UseItems[nWhere]->MakeIndex, PlayObject.m_MyHero.m_UseItems[nWhere]->wIndex);
                            }
                            if (sUserItemName == "")
                            {
                                sUserItemName = UserEngine.GetStdItemName(PlayObject.m_MyHero.m_UseItems[nWhere]->wIndex);
                            }
                            if ((sUserItemName).ToLower().CompareTo((sItemName).ToLower()) == 0)
                            {
                                nItemIdx = PlayObject.m_MyHero.m_UseItems[nWhere]->MakeIndex;
                                PlayObject.ClientHeroTakeOffItems((byte)nWhere, nItemIdx, sItemName);
                                ((THeroObject)(PlayObject.m_MyHero)).SendUseitems(); // 发送使用的物品
                            }
                        }
                    }
                }
                else
                {
                    if (PlayObject.m_UseItems[nWhere]->wIndex > 0)
                    {
                        sUserItemName = "";
                        if (PlayObject.m_MyHero.m_UseItems[nWhere]->btValue[13] == 1)
                        {
                            sUserItemName = ItemUnit.GetCustomItemName(PlayObject.m_UseItems[nWhere]->MakeIndex, PlayObject.m_UseItems[nWhere]->wIndex);
                        }
                        if (sUserItemName == "")
                        {
                            sUserItemName = UserEngine.GetStdItemName(PlayObject.m_UseItems[nWhere]->wIndex);
                        }
                        if ((sUserItemName).ToLower().CompareTo((sItemName).ToLower()) == 0)
                        {
                            nItemIdx = PlayObject.m_UseItems[nWhere]->MakeIndex;
                            PlayObject.ClientTakeOffItems((byte)nWhere, nItemIdx, sItemName);
                            PlayObject.SendUseitems();// 发送使用的物品
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfTakeOffItem");
            }
        }

        /// <summary>
        /// 功能:创建英雄数据
        /// 格式:CREATEHERO 2 1 TRUE 使用方法跟原来的一样，只是后面加个参数TRUE，代表为创建第二个英雄
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCreateHero(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nJob;
            int nSex;
            int nHair = 0;
            string sMsg;
            string sAccount;
            string sChrName;
            string sHair;
            string sJob;
            string sSex;
            string sLevel;
            string sHeroType;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nJob = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);// 职业
                nSex = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);// 性别
                if ((nJob < 0) || (nSex < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CREATEHERO);
                    return;
                }
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("TRUE").ToLower()) == 0) // 创建卧龙英雄
                {
                    if ((PlayObject.m_sTempHeroCharName.Trim() != "") && (!PlayObject.m_boHasHeroTwo))
                    {
                        switch (nSex)
                        {
                            case 0:
                                nHair = 2;
                                break;
                            case 1:
                                switch (HUtil32.Random(2))
                                {
                                    case 0:
                                        nHair = 1;
                                        break;
                                    case 1:
                                        nHair = 3;
                                        break;
                                }
                                break;
                        }
                        sAccount = PlayObject.m_sUserID;
                        PlayObject.m_sHeroCharName = PlayObject.m_sTempHeroCharName.Trim();
                        sChrName = PlayObject.m_sHeroCharName;
                        PlayObject.m_sTempHeroCharName = "";
                        sHair = (nHair).ToString();
                        sJob = (nJob).ToString();
                        sSex = (nSex).ToString();
                        sLevel = (M2Share.g_Config.nDrinkHeroStartLevel).ToString();
                        sHeroType = 1.ToString();// 英雄类型
                        PlayObject.n_tempHeroTpye = 1;
                        sMsg = sAccount + "/" + sChrName + "/" + sHair + "/" + sJob + "/" + sSex + "/" + sLevel + "/" + PlayObject.m_sCharName + "/" + sHeroType;// 增加主人的名字
                        M2Share.FrontEngine.AddToLoadHeroRcdList(sChrName, sMsg, PlayObject, 1);
                    }
                    else
                    {
                        GotoLable(PlayObject, "@CreateHeroFailEx", false);
                    }
                }
                else
                {
                    if ((PlayObject.m_sTempHeroCharName.Trim() != "") && (!PlayObject.m_boHasHero))// 白日门英雄
                    {
                        switch (nSex)
                        {
                            case 0:
                                nHair = 2;
                                break;
                            case 1:
                                switch (HUtil32.Random(2))
                                {
                                    case 0:
                                        nHair = 1;
                                        break;
                                    case 1:
                                        nHair = 3;
                                        break;
                                }
                                break;
                        }
                        sAccount = PlayObject.m_sUserID;
                        PlayObject.m_sHeroCharName = PlayObject.m_sTempHeroCharName.Trim();
                        sChrName = PlayObject.m_sHeroCharName;
                        PlayObject.m_sTempHeroCharName = "";
                        sHair = (nHair).ToString();
                        sJob = (nJob).ToString();
                        sSex = (nSex).ToString();
                        sLevel = (M2Share.g_Config.nHeroStartLevel).ToString();
                        sHeroType = 0.ToString();// 英雄类型
                        PlayObject.n_tempHeroTpye = 0;
                        sMsg = sAccount + "/" + sChrName + "/" + sHair + "/" + sJob + "/" + sSex + "/" + sLevel + "/" + PlayObject.m_sCharName + "/" + sHeroType;// 增加主人的名字
                        M2Share.FrontEngine.AddToLoadHeroRcdList(sChrName, sMsg, PlayObject, 1);
                    }
                    else
                    {
                        GotoLable(PlayObject, "@CreateHeroFailEx", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCreateHero");
            }
        }

        /// <summary>
        ///  删除英雄 对应的NPC才能删除对应的英雄
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfDeleteHero(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((this) as TMerchant).m_boBuHero) // 卧龙英雄NPC
                {
                    if ((PlayObject.m_boHasHeroTwo) && (PlayObject.n_myHeroTpye == 1))
                    {
                        if ((PlayObject.m_MyHero != null) && (!PlayObject.m_MyHero.m_boDeath))
                        {
                            GotoLable(PlayObject, "@LogOutHeroFirst", false);
                        }
                        else
                        {
                            M2Share.FrontEngine.AddToLoadHeroRcdList(PlayObject.m_sHeroCharName, "", PlayObject, 2);
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@NotHaveHero", false);
                    }
                }
                else
                {
                    if ((PlayObject.m_boHasHero) && (PlayObject.n_myHeroTpye == 0)) // 白日门英雄NPC
                    {
                        if ((PlayObject.m_MyHero != null) && (!PlayObject.m_MyHero.m_boDeath))
                        {
                            GotoLable(PlayObject, "@LogOutHeroFirst", false);
                        }
                        else
                        {
                            M2Share.FrontEngine.AddToLoadHeroRcdList(PlayObject.m_sHeroCharName, "", PlayObject, 2);
                        }
                    }
                    else
                    {
                        GotoLable(PlayObject, "@NotHaveHero", false);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDeleteHero");
            }
        }

        /// <summary>
        /// 功能:改变英雄等级
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeHeroLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            bool boChgOK;
            int nLevel = 0;
            int nLv = 0;
            int nOldLevel = 0;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROLEVEL);
                    return;
                }
                if (PlayObject.m_MyHero != null)
                {
                    boChgOK = false;
                    nOldLevel = PlayObject.m_MyHero.m_Abil.Level;
                    nLevel = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                    if ((nLevel < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLevel)))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROLEVEL);
                        return;
                    }
                    cMethod = QuestActionInfo.sParam1[1];
                    switch (cMethod)
                    {
                        case '=':
                            if ((nLevel > 0) && (nLevel <= M2Share.MAXLEVEL))
                            {
                                PlayObject.m_MyHero.m_Abil.Level = (ushort)nLevel;
                                boChgOK = true;
                            }
                            break;
                        case '-':
                            nLv = HUtil32._MAX(0, PlayObject.m_MyHero.m_Abil.Level - nLevel);
                            nLv = HUtil32._MIN(M2Share.MAXLEVEL, nLv);
                            PlayObject.m_MyHero.m_Abil.Level = (ushort)nLv;
                            boChgOK = true;
                            break;
                        case '+':
                            nLv = HUtil32._MAX(0, PlayObject.m_MyHero.m_Abil.Level + nLevel);
                            nLv = HUtil32._MIN(M2Share.MAXLEVEL, nLv);
                            PlayObject.m_MyHero.m_Abil.Level = (ushort)nLv;
                            boChgOK = true;
                            break;
                    }
                    if (boChgOK)
                    {
                        PlayObject.m_MyHero.HasLevelUp(nOldLevel);// 等级调整记录日志
                        M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_MyHero.m_sMapName + "\09" + (PlayObject.m_MyHero.m_nCurrX).ToString() 
                            + "\09" + (PlayObject.m_MyHero.m_nCurrY).ToString() + "\09" + PlayObject.m_MyHero.m_sCharName + "\09" + (PlayObject.m_MyHero.m_Abil.Level).ToString()
                            + "\09" + "1" + "\09" + cMethod + "(" + (nLv).ToString() + ")" + "\09" + this.m_sCharName);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeHeroLevel");
            }
        }

        /// <summary>
        /// 功能:改变英雄职业
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeHeroJob(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nJob;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROJOB);
                    return;
                }
                nJob = -1;
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "WARRIOR", 3))
                {
                    nJob = 0;
                }
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "WIZARD", 3))
                {
                    nJob = 1;
                }
                if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "TAOIST", 3))
                {
                    nJob = 2;
                }
                if (nJob < 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROJOB);
                    return;
                }
                if (PlayObject.m_MyHero != null)
                {
                    if (PlayObject.m_MyHero.m_btJob != nJob)
                    {
                        PlayObject.m_MyHero.m_btJob = (byte)nJob;
                        PlayObject.m_MyHero.HasLevelUp(0);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeHeroJob");
            }
        }

        /// <summary>
        /// 功能:清除英雄技能
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfClearHeroSkill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserMagic* UserMagic;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CLEARHEROSKILL);
                    return;
                }
                if (PlayObject.m_MyHero != null)
                {
                    if (QuestActionInfo.sParam1 != "")  // 指定技能名称,则删除指定的技能
                    {
                        for (int I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                            {
                                break;
                            }
                            UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                            if (UserMagic != null)
                            {
                                if (HUtil32.SBytePtrToString(UserMagic->MagicInfo.sMagicName, 0, UserMagic->MagicInfo.MagicNameLen).ToLower().CompareTo((QuestActionInfo.sParam1).ToLower()) == 0)
                                {
                                    ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                                    UserMagic = null;
                                    PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                                    break;
                                }
                            }
                        }
                    }
                    else // 没有指定技能名称,则删除全部技能
                    {
                        for (int I = PlayObject.m_MyHero.m_MagicList.Count - 1; I >= 0; I--)
                        {
                            if (PlayObject.m_MyHero.m_MagicList.Count <= 0)
                            {
                                break;
                            }
                            UserMagic = (TUserMagic*)PlayObject.m_MyHero.m_MagicList[I];
                            ((THeroObject)(PlayObject.m_MyHero)).SendDelMagic(UserMagic);
                            UserMagic = null;
                            PlayObject.m_MyHero.m_MagicList.RemoveAt(I);
                        }
                    }
                    ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                    PlayObject.m_MyHero.CompareSuitItem(false);//套装
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearHeroSkill");
            }
        }

        /// <summary>
        /// 功能：改变英雄PK点数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeHeroPKPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nPKPOINT;
            int nPoint;
            int nOldPKLevel;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROPKPOINT);
                    return;
                }
                if (PlayObject.m_MyHero != null)
                {
                    nOldPKLevel = PlayObject.m_MyHero.PKLevel();
                    nPKPOINT = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                    if ((nPKPOINT < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nPKPOINT)))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROPKPOINT);
                        return;
                    }
                    cMethod = QuestActionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if ((nPKPOINT >= 0))
                            {
                                PlayObject.m_MyHero.m_nPkPoint = nPKPOINT;
                            }
                            break;
                        case '-':
                            nPoint = HUtil32._MAX(0, PlayObject.m_MyHero.m_nPkPoint - nPKPOINT);
                            PlayObject.m_MyHero.m_nPkPoint = nPoint;
                            break;
                        case '+':
                            nPoint = HUtil32._MAX(0, PlayObject.m_MyHero.m_nPkPoint + nPKPOINT);
                            PlayObject.m_MyHero.m_nPkPoint = nPoint;
                            break;
                    }
                    if (nOldPKLevel != PlayObject.m_MyHero.PKLevel())
                    {
                        PlayObject.m_MyHero.RefNameColor();
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeHeroPKPoint");
            }
        }

        /// <summary>
        /// 功能:给矿石
        /// 命令格式:GIVEMINE 矿名称 数量 纯度
        /// 如纯度不填,则随机给纯度
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfGIVEMINE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMineName;
            int nMineCount;
            int nDura;
            int I;
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMineName = QuestActionInfo.sParam1;// 矿名
                nMineCount = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);// 数量
                nDura = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);// 纯度
                if ((nMineCount <= 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nMineCount)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GIVEMINE);
                    return;
                }
                if (nDura < 0)
                {
                    nDura = HUtil32.Random(18) + 3;
                }
                if ((sMineName == "") || (nMineCount < 0) || (nDura < 0) || (nDura > 100))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GIVEMINE);
                    return;
                }
                if (nMineCount > 0)
                {
                    for (I = 0; I < nMineCount; I++)
                    {
                        UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                        if (UserEngine.CopyToUserItemFromName(sMineName, UserItem))
                        {
                            StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                            if ((StdItem != null))
                            {
                                if ((StdItem->StdMode == 43))
                                {
                                    if (this.IsAddWeightAvailable(StdItem->Weight * nMineCount))
                                    {
                                        UserItem->Dura = Convert.ToUInt16(nDura * 1000);
                                        if (UserItem->Dura > UserItem->DuraMax)
                                        {
                                            UserItem->Dura = UserItem->DuraMax;
                                        }
                                        if (StdItem->NeedIdentify == 1) // 记录游戏日志
                                        {
                                            M2Share.AddGameDataLog("39" + "\09" + this.m_sMapName + "\09" + this.m_nCurrX + "\09" + this.m_nCurrY
                                                + "\09" + PlayObject.m_sCharName + "\09" + HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen) + "\09" + UserItem->MakeIndex + "\09"
                                                + UserItem->Dura + "/" + UserItem->DuraMax + "\09" + this.m_sCharName);
                                        }
                                        PlayObject.m_ItemList.Add((IntPtr)UserItem);
                                        PlayObject.SendAddItem(UserItem);
                                    }
                                }
                            }
                        }
                        else
                        {
                            Marshal.FreeHGlobal((IntPtr)UserItem);
                            break;
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGIVEMINE");
            }
        }

        /// <summary>
        /// 功能:改变英雄的经验
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeHeroExp(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nExp;
            char cMethod;
            UInt32 dwInt;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROEXP);
                    return;
                }
                nExp = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((nExp < 0) && (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nExp)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEHEROEXP);
                    return;
                }
                if (PlayObject.m_MyHero != null)
                {
                    cMethod = QuestActionInfo.sParam1[0];
                    switch (cMethod)
                    {
                        case '=':
                            if (nExp >= 0)
                            {
                                PlayObject.m_MyHero.m_Abil.Exp = (uint)nExp;
                                dwInt = (uint)nExp;
                            }
                            break;
                        case '-':
                            if (PlayObject.m_MyHero.m_Abil.Exp > nExp)
                            {
                                PlayObject.m_MyHero.m_Abil.Exp -= (uint)nExp;
                            }
                            else
                            {
                                PlayObject.m_MyHero.m_Abil.Exp = 0;
                            }
                            break;
                        case '+':
                            if (PlayObject.m_MyHero.m_Abil.Level < M2Share.g_Config.nLimitExpLevel) // 是否超过限制等级 修改
                            {
                                dwInt = (uint)nExp;
                            }
                            else
                            {
                                dwInt = M2Share.g_Config.nLimitExpValue;
                            }
                            ((THeroObject)(PlayObject.m_MyHero)).GetExp(dwInt);
                            break;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeHeroExp");
            }
        }

        private unsafe void ActionOfRepairItem(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nWhere;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1) >= 0)
                {
                    nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                    if ((nWhere >= m_UseItems.GetLowerBound(0) && nWhere <= m_UseItems.GetUpperBound(0)))
                    {
                        if (PlayObject.m_UseItems[nWhere]->wIndex > 0)
                        {
                            StdItem = UserEngine.GetStdItem(PlayObject.m_UseItems[nWhere]->wIndex);
                            if (StdItem != null)
                            {
                                if ((PlayObject.m_UseItems[nWhere]->DuraMax > PlayObject.m_UseItems[nWhere]->Dura) && (StdItem->StdMode != 43))
                                {
                                    if (this.CheckItemValue(PlayObject.m_UseItems[nWhere], 3))// 禁止修
                                    {
                                        return;
                                    }
                                    else if (PlayObject.PlugOfCheckCanItem(3, HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), false, 0, 0)) // 禁止物品规则(管理插件功能)
                                    {
                                        return;
                                    }
                                    PlayObject.m_UseItems[nWhere]->Dura = PlayObject.m_UseItems[nWhere]->DuraMax;
                                    PlayObject.SendMsg(PlayObject, Grobal2.RM_DURACHANGE, nWhere, PlayObject.m_UseItems[nWhere]->Dura, PlayObject.m_UseItems[nWhere]->DuraMax, 0, "");
                                }
                            }
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_REPAIRITEM);
                    }
                }
                else if (HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1) < 0)
                {
                    for (nWhere = m_UseItems.GetLowerBound(0); nWhere <= m_UseItems.GetUpperBound(0); nWhere++)
                    {
                        if (PlayObject.m_UseItems[nWhere]->wIndex > 0)
                        {
                            StdItem = UserEngine.GetStdItem(PlayObject.m_UseItems[nWhere]->wIndex);
                            if (StdItem != null)
                            {
                                if ((PlayObject.m_UseItems[nWhere]->DuraMax > PlayObject.m_UseItems[nWhere]->Dura) && (StdItem->StdMode != 43))
                                {
                                    if (this.CheckItemValue(PlayObject.m_UseItems[nWhere], 3)) // 禁止修
                                    {
                                        continue;
                                    }
                                    else if (PlayObject.PlugOfCheckCanItem(3, HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), false, 0, 0)) // 禁止物品规则(管理插件功能)
                                    {
                                        continue;
                                    }
                                    PlayObject.m_UseItems[nWhere]->Dura = PlayObject.m_UseItems[nWhere]->DuraMax;
                                    PlayObject.SendMsg(PlayObject, Grobal2.RM_DURACHANGE, nWhere, PlayObject.m_UseItems[nWhere]->Dura, PlayObject.m_UseItems[nWhere]->DuraMax, 0, "");
                                }
                            }
                        }
                    }
                }
                else
                {
                    // ScriptActionError(PlayObject, '', QuestActionInfo, sSC_REPAIRITEM);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRepairItem");
            }
        }

        private void ActionOfOpenMakeKIMNeedle(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
        }

        private unsafe void ActionOfTAKEKIMNEEDLE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int I;
            TUserItem* UserItem;
            TStdItem* StdItem;
            int nCount;
            string sName = string.Empty;
            // ----------------------------------------------------------------------------------------
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            // ======================================================================
            PlayObject.m_boCanQueryBag = true;// NPC操作物品时,不能刷新包裹
            try
            {
                sName = QuestActionInfo.sParam1;
                nCount = QuestActionInfo.nParam2;
                if (sName == "")
                {
                    return;
                }
                if (nCount <= 0)
                {
                    return;
                }
                try
                {
                    for (I = PlayObject.m_ItemList.Count - 1; I >= 0; I--)
                    {
                        if (nCount <= 0)
                        {
                            break;
                        }
                        if (PlayObject.m_ItemList.Count <= 0)
                        {
                            break;
                        }
                        UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                        if (UserItem == null)
                        {
                            continue;
                        }
                        if ((UserEngine.GetStdItemName(UserItem->wIndex)).ToLower().CompareTo((sName).ToLower()) == 0)
                        {
                            StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                            if (StdItem != null)
                            {
                                if (StdItem->NeedIdentify == 1)
                                {
                                    M2Share.AddGameDataLog("10" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString()
                                        + "\09" + PlayObject.m_sCharName + "\09" + sName + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString()
                                        + "/" + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")"
                                        + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() + "/"
                                        + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")"
                                        + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString()
                                        + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString()
                                        + "/" + (UserItem->btValue[8]).ToString() + "/" + (UserItem->btValue[14]).ToString() + "\09" + this.m_sCharName);
                                }
                                PlayObject.m_ItemList.RemoveAt(I);
                                PlayObject.SendDelItems(UserItem);
                                Marshal.FreeHGlobal((IntPtr)UserItem);
                                nCount -= 1;
                            }
                        }
                    }
                }
                catch
                {
                    M2Share.MainOutMessage("{异常} TakeKimItem");
                }
            }
            finally
            {
                PlayObject.m_boCanQueryBag = false; // NPC操作物品时,不能刷新包裹
            }
        }

        private void ActionOfGIVEKIMNEEDLE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
        }

        private void ActionOfOPENPULSE(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if ((QuestActionInfo.nParam1 >= 0 && QuestActionInfo.nParam1 <= 3) && (QuestActionInfo.nParam2 >= 1 && QuestActionInfo.nParam2 <= 5))
                {
                    if ((QuestActionInfo.sParam3).ToLower().CompareTo(("Hero").ToLower()) == 0)
                    {
                        if (PlayObject.m_MyHero != null)
                        {
                            if (((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[QuestActionInfo.nParam1].Pulse == QuestActionInfo.nParam2 - 1)
                            {
                                //((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[QuestActionInfo.nParam1].Pulse = QuestActionInfo.nParam2;
                                ((THeroObject)(PlayObject.m_MyHero)).SendMsg(PlayObject, Grobal2.RM_HEROPULSECHANGED, 1, 0, 0, 0, "");
                                ((THeroObject)(PlayObject.m_MyHero)).SendRefMsg(Grobal2.RM_MYSHOW, 13, 0, 0, 0, "");
                            }
                        }
                    }
                    else
                    {
                        if (PlayObject.m_HumPulses[QuestActionInfo.nParam1].Pulse == QuestActionInfo.nParam2 - 1)
                        {
                            //PlayObject.m_HumPulses[QuestActionInfo.nParam1].Pulse = QuestActionInfo.nParam2;
                            PlayObject.SendMsg(PlayObject, Grobal2.RM_PULSECHANGED, 0, 0, 0, 0, "");
                            PlayObject.SendRefMsg(Grobal2.RM_MYSHOW, 13, 0, 0, 0, "");
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOPENPULSE");
            }
        }

        private void ActionOfChangePulseLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int i01;
            int i02;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            i01 = QuestActionInfo.nParam1;
            i02 = QuestActionInfo.nParam3;
            if ((QuestActionInfo.sParam4).ToLower().CompareTo(("Hero").ToLower()) == 0)
            {
                if (PlayObject.m_MyHero != null)
                {
                    if ((i01 >= 0) && (i02 >= 0))
                    {
                        if (QuestActionInfo.sParam2 == "+")
                        {
                            if ((((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel + i02) <= 5)
                            {
                                ((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel = Convert.ToByte(((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel + i02);
                            }
                        }
                        else if (QuestActionInfo.sParam2 == "-")
                        {
                            if ((((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel - i02) >= 1)
                            {
                                ((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel = Convert.ToByte(((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel + i02);
                            }
                        }
                        else if (QuestActionInfo.sParam2 == "=")
                        {
                            if (i02 >= 0 && i02 <= 5)
                            {
                                ((THeroObject)(PlayObject.m_MyHero)).m_HumPulses[i01].PulseLevel = (byte)i02;
                            }
                        }
                        // THeroobject(PlayObject.m_MyHero).SendMsg(Self,RM_RUSHPULSE_OK, 0, 0, 0, 1, '');
                        ((THeroObject)(PlayObject.m_MyHero)).SendMsg(this, Grobal2.RM_HEROPULSECHANGED, 0, 0, 0, 1, "");
                    }
                }
            }
            else
            {
                if ((i01 >= 0) && (i02 >= 0))
                {
                    if (QuestActionInfo.sParam2 == "+")
                    {
                        if ((PlayObject.m_HumPulses[i01].PulseLevel + i02) <= 5)
                        {
                            PlayObject.m_HumPulses[i01].PulseLevel = Convert.ToByte(PlayObject.m_HumPulses[i01].PulseLevel + i02);
                        }
                    }
                    else if (QuestActionInfo.sParam2 == "-")
                    {
                        if ((PlayObject.m_HumPulses[i01].PulseLevel - i02) >= 1)
                        {
                            PlayObject.m_HumPulses[i01].PulseLevel = Convert.ToByte(PlayObject.m_HumPulses[i01].PulseLevel + i02);
                        }
                    }
                    else if (QuestActionInfo.sParam2 == "=")
                    {
                        if (i02 >= 0 && i02 <= 5)
                        {
                            PlayObject.m_HumPulses[i01].PulseLevel = (byte)i02;
                        }
                    }
                    PlayObject.SendMsg(this, Grobal2.RM_RUSHPULSE_OK, 0, 0, 0, 0, "");
                    PlayObject.SendMsg(this, Grobal2.RM_PULSECHANGED, 0, 0, 0, 0, "");
                }
            }
        }

        private void ExeAction(TPlayObject PlayObject, string sParam1, string sParam2, string sParam3, int nParam1, int nParam2, uint nParam3)
        {
            int nInt1;
            uint dwInt;
            try
            {
                // ================================================
                // 更改人物当前经验值
                // EXEACTION CHANGEEXP 0 经验数  设置为指定经验值
                // EXEACTION CHANGEEXP 1 经验数  增加指定经验
                // EXEACTION CHANGEEXP 2 经验数  减少指定经验
                // ================================================
                if ((sParam1).ToLower().CompareTo(("CHANGEEXP").ToLower()) == 0)
                {
                    nInt1 = HUtil32.Str_ToInt(sParam2, -1);
                    switch (nInt1)
                    {
                        case 0:
                            if (nParam3 >= 0)
                            {
                                PlayObject.m_Abil.Exp = nParam3;
                                PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);
                            }
                            break;
                        case 1:
                            if (PlayObject.m_Abil.Exp >= nParam3)
                            {
                                if ((PlayObject.m_Abil.Exp - nParam3) > (uint.MaxValue - PlayObject.m_Abil.Exp))
                                {
                                    dwInt = int.MaxValue - PlayObject.m_Abil.Exp;
                                }
                                else
                                {
                                    dwInt = nParam3;
                                }
                            }
                            else
                            {
                                if ((nParam3 - PlayObject.m_Abil.Exp) > (uint.MaxValue - (uint)nParam3))
                                {
                                    dwInt = uint.MaxValue - nParam3;
                                }
                                else
                                {
                                    dwInt = nParam3;
                                }
                            }
                            PlayObject.m_Abil.Exp += dwInt;
                            PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);
                            break;
                        case 2:
                            if (PlayObject.m_Abil.Exp > nParam3)
                            {
                                PlayObject.m_Abil.Exp -= nParam3;
                            }
                            else
                            {
                                PlayObject.m_Abil.Exp = 0;
                            }
                            PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);
                            break;
                    }
                    PlayObject.SysMsg("您当前经验点数为: " + (PlayObject.m_Abil.Exp).ToString() + "/" + (PlayObject.m_Abil.MaxExp).ToString(), TMsgColor.c_Green, TMsgType.t_Hint);
                    return;
                }
                // ================================================
                // 更改人物当前等级
                // EXEACTION CHANGELEVEL 0 等级数  设置为指定等级
                // EXEACTION CHANGELEVEL 1 等级数  增加指定等级
                // EXEACTION CHANGELEVEL 2 等级数  减少指定等级
                // ================================================
                if ((sParam1).ToLower().CompareTo(("CHANGELEVEL").ToLower()) == 0)
                {
                    nInt1 = HUtil32.Str_ToInt(sParam2, -1);
                    switch (nInt1)
                    {
                        case 0:
                            if (nParam3 >= 0)
                            {
                                PlayObject.m_Abil.Level = (ushort)nParam3;
                                PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);// 等级调整记录日志
                                M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" 
                                    + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString() + "\09" 
                                    + "0" + "\09" + "=(" + ((uint)nParam3).ToString() + ")" + "\09" + this.m_sCharName);
                            }
                            break;
                        case 1:
                            if (PlayObject.m_Abil.Level >= (uint)nParam3)
                            {
                                if ((PlayObject.m_Abil.Level - (uint)nParam3) > (uint.MaxValue - PlayObject.m_Abil.Level))
                                {
                                    dwInt = uint.MaxValue - PlayObject.m_Abil.Level;
                                }
                                else
                                {
                                    dwInt = nParam3;
                                }
                            }
                            else
                            {
                                if (((uint)nParam3 - PlayObject.m_Abil.Level) > (uint.MaxValue - (uint)nParam3))
                                {
                                    dwInt = uint.MaxValue - nParam3;
                                }
                                else
                                {
                                    dwInt = nParam3;
                                }
                            }
                            PlayObject.m_Abil.Level += (ushort)dwInt;
                            PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);// 等级调整记录日志
                            M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" 
                                + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString() 
                                + "\09" + "0" + "\09" + "+(" + (dwInt).ToString() + ")" + "\09" + this.m_sCharName);
                            break;
                        case 2:
                            if (PlayObject.m_Abil.Level > (uint)nParam3)
                            {
                                PlayObject.m_Abil.Level -= (ushort)nParam3;
                            }
                            else
                            {
                                PlayObject.m_Abil.Level = 0;
                            }
                            PlayObject.HasLevelUp(PlayObject.m_Abil.Level - 1);// 等级调整记录日志
                            M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" 
                                + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString() 
                                + "\09" + "0" + "\09" + "-(" + ((uint)nParam3).ToString() + ")" + "\09" + this.m_sCharName);
                            break;
                    }
                    PlayObject.SysMsg("您当前等级为: " + (PlayObject.m_Abil.Level).ToString(), TMsgColor.c_Green, TMsgType.t_Hint);
                    return;
                }
                // ================================================
                // 杀死人物
                // EXEACTION KILL 0 人物死亡,不显示凶手信息
                // EXEACTION KILL 1 人物死亡不掉物品,不显示凶手信息
                // EXEACTION KILL 2 人物死亡,显示凶手信息为NPC
                // EXEACTION KILL 3 人物死亡不掉物品,显示凶手信息为NPC
                // ================================================
                if ((sParam1).ToLower().CompareTo(("KILL").ToLower()) == 0)
                {
                    nInt1 = HUtil32.Str_ToInt(sParam2, -1);
                    switch (nInt1)
                    {
                        case 1:
                            PlayObject.m_boNoItem = true;
                            PlayObject.Die();
                            break;
                        case 2:
                            PlayObject.SetLastHiter(this);
                            PlayObject.Die();
                            break;
                        case 3:
                            PlayObject.m_boNoItem = true;
                            PlayObject.SetLastHiter(this);
                            PlayObject.Die();
                            break;
                        default:
                            PlayObject.Die();
                            break;
                    }
                    return;
                }
                // ================================================
                // 踢人物下线
                // EXEACTION KICK
                // ================================================
                if ((sParam1).ToLower().CompareTo(("KICK").ToLower()) == 0)
                {
                    PlayObject.m_boKickFlag = true;
                    return;
                }
                // ==============================================================================
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ExeAction");
            }
        }

        /// <summary>
        /// 取行文本变量信息
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sMsg"></param>
        /// <returns></returns>
        public string GetLineVariableText(TPlayObject PlayObject, string sMsg)
        {
            string result = string.Empty;
            int nC;
            string s10 = string.Empty;
            try
            {
                nC = 0;
                while (true)
                {
                    if (HUtil32.TagCount(sMsg, '>') < 1)
                    {
                        break;
                    }
                    HUtil32.ArrestStringEx(sMsg, "<", ">", ref s10);
                    GetVariableText(PlayObject, ref sMsg, s10);
                    nC++;
                    if (nC >= 101)
                    {
                        break;
                    }
                }
                result = sMsg;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.GetLineVariableText");
            }
            return result;
        }

        /// <summary>
        /// 取变量文本
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sMsg"></param>
        /// <param name="sVariable"></param>
        public unsafe virtual void GetVariableText(TPlayObject PlayObject, ref string sMsg, string sVariable)
        {
            string sText = string.Empty;
            string s14 = string.Empty;
            int n18;
            ushort wHour;
            ushort wMinute;
            ushort wSecond;
            int nSecond;
            TDynamicVar DynamicVar;
            bool boFoundVar;
            string s1C;
            TPlayObject PoseHuman;
            try
            {
                // 显示人物排行
                if (sVariable == "$LEVELORDER")
                {
                    s1C = "";
                    if (PlayObject.m_PlayOrderList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_PlayOrderList.Count; I++)
                        {
                            s1C = s1C + PlayObject.m_PlayOrderList[I];
                        }
                    }
                    sMsg = sub_49ADB8(sMsg, "<$LEVELORDER>", s1C);
                    return;
                }
                if (sVariable == "$DEALGOLDPLAY")
                {
                    PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                    if ((PoseHuman != null) && (((TPlayObject)(PoseHuman.GetPoseCreate())) == PlayObject) && (PoseHuman.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                    {
                        sMsg = sub_49ADB8(sMsg, "<$DEALGOLDPLAY>", PoseHuman.m_sCharName);
                    }
                    else
                    {
                        sMsg = sub_49ADB8(sMsg, "<$DEALGOLDPLAY>", "????");
                    }
                    return;
                }
                // 全局信息
                if (sVariable == "$SERVERNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$SERVERNAME>", M2Share.g_Config.sServerName);
                    return;
                }
                if (sVariable == "$SERVERIP")
                {
                    sMsg = sub_49ADB8(sMsg, "<$SERVERIP>", M2Share.g_Config.sServerIPaddr);
                    return;
                }
                if (sVariable == "$WEBSITE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$WEBSITE>", M2Share.g_Config.sWebSite);
                    return;
                }
                if (sVariable == "$BBSSITE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BBSSITE>", M2Share.g_Config.sBbsSite);
                    return;
                }
                if (sVariable == "$CLIENTDOWNLOAD")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CLIENTDOWNLOAD>", M2Share.g_Config.sClientDownload);
                    return;
                }
                if (sVariable == "$QQ")
                {
                    sMsg = sub_49ADB8(sMsg, "<$QQ>", M2Share.g_Config.sQQ);
                    return;
                }
                if (sVariable == "$PHONE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$PHONE>", M2Share.g_Config.sPhone);
                    return;
                }
                if (sVariable == "$BANKACCOUNT0")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT0>", M2Share.g_Config.sBankAccount0);
                    return;
                }
                if (sVariable == "$BANKACCOUNT1")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT1>", M2Share.g_Config.sBankAccount1);
                    return;
                }
                if (sVariable == "$BANKACCOUNT2")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT2>", M2Share.g_Config.sBankAccount2);
                    return;
                }
                if (sVariable == "$BANKACCOUNT3")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT3>", M2Share.g_Config.sBankAccount3);
                    return;
                }
                if (sVariable == "$BANKACCOUNT4")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT4>", M2Share.g_Config.sBankAccount4);
                    return;
                }
                if (sVariable == "$BANKACCOUNT5")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT5>", M2Share.g_Config.sBankAccount5);
                    return;
                }
                if (sVariable == "$BANKACCOUNT6")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT6>", M2Share.g_Config.sBankAccount6);
                    return;
                }
                if (sVariable == "$BANKACCOUNT7")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT7>", M2Share.g_Config.sBankAccount7);
                    return;
                }
                if (sVariable == "$BANKACCOUNT8")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT8>", M2Share.g_Config.sBankAccount8);
                    return;
                }
                if (sVariable == "$BANKACCOUNT9")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BANKACCOUNT9>", M2Share.g_Config.sBankAccount9);
                    return;
                }
                if (sVariable == "$GAMEGOLDNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$GAMEGOLDNAME>", M2Share.g_Config.sGameGoldName);
                    return;
                }
                if (sVariable == "$GAMEDIAMONDNAME")
                {
                    // 金刚石
                    sMsg = sub_49ADB8(sMsg, "<$GAMEDIAMONDNAME>", M2Share.g_Config.sGameDiaMond);
                    return;
                }
                if (sVariable == "$GAMEGIRDNAME")
                {
                    // 灵符
                    sMsg = sub_49ADB8(sMsg, "<$GAMEGIRDNAME>", M2Share.g_Config.sGameGird);
                    return;
                }
                if (sVariable == "$GAMEPOINTNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$GAMEPOINTNAME>", M2Share.g_Config.sGamePointName);
                    return;
                }
                if (sVariable == "$USERCOUNT")
                {
                    sText = (UserEngine.PlayObjectCount).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$USERCOUNT>", sText);
                    return;
                }
                if (sVariable == "$MACRUNTIME")
                {
                    // (24 * 60 * 60 * 1000)
                    sText = (HUtil32.GetTickCount() / 86400000).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MACRUNTIME>", sText);
                    return;
                }
                if (sVariable == "$SERVERRUNTIME")
                {
                    nSecond = Convert.ToInt32((HUtil32.GetTickCount() - M2Share.g_dwStartTick) / 1000);
                    wHour = Convert.ToUInt16(nSecond / 3600);
                    wMinute = Convert.ToUInt16((nSecond / 60) % 60);
                    wSecond = Convert.ToUInt16(nSecond % 60);
                    sText = string.Format("{0}:{1}:{2}", wHour, wMinute, wSecond);
                    sMsg = sub_49ADB8(sMsg, "<$SERVERRUNTIME>", sText);
                    return;
                }
                if (sVariable == "$DATETIME")
                {
                    sText = HUtil32.FormatDateTime("dddddd,ddd,hh:mm:MM", DateTime.Now);
                    sMsg = sub_49ADB8(sMsg, "<$DATETIME>", sText);
                    return;
                }
                if (sVariable == "$HIGHLEVELINFO")
                {
                    // 最高等级人物数据
                    if (((TPlayObject)(M2Share.g_HighLevelHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighLevelHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHLEVELINFO>", sText);
                    return;
                }
                if (sVariable == "$HIGHPKINFO")
                {
                    // 最高PK值人物数据
                    if (((TPlayObject)(M2Share.g_HighPKPointHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighPKPointHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHPKINFO>", sText);
                    return;
                }
                if (sVariable == "$HIGHDCINFO")
                {
                    // 最高攻击力人物数据
                    if (((TPlayObject)(M2Share.g_HighDCHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighDCHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHDCINFO>", sText);
                    return;
                }
                if (sVariable == "$HIGHMCINFO")
                {
                    // 最高魔法力人物数据
                    if (((TPlayObject)(M2Share.g_HighMCHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighMCHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHMCINFO>", sText);
                    return;
                }
                if (sVariable == "$HIGHSCINFO")
                {
                    // 最高道术人物数据
                    if (((TPlayObject)(M2Share.g_HighSCHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighSCHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHSCINFO>", sText);
                    return;
                }
                if (sVariable == "$HIGHONLINEINFO")
                {
                    // 最高在线时长人物数据
                    if (((TPlayObject)(M2Share.g_HighOnlineHuman)) != null)
                    {
                        sText = ((TPlayObject)(M2Share.g_HighOnlineHuman)).GetMyInfo();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HIGHONLINEINFO>", sText);
                    return;
                }
                // 个人信息
                if (sVariable == "$USERNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$USERNAME>", PlayObject.m_sCharName);
                    return;
                }
                if (sVariable == "$USERALLNAME") // 全名 
                {
                    sMsg = sub_49ADB8(sMsg, "<$USERALLNAME>", PlayObject.GetShowName());
                    return;
                }
                if (sVariable == "$SFNAME") // 师傅名
                {
                    sMsg = sub_49ADB8(sMsg, "<$SFNAME>", PlayObject.m_sMasterName);
                    return;
                }
                if (sVariable == "$HERONAME") // 英雄名
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        sMsg = sub_49ADB8(sMsg, "<$HERONAME>", ((THeroObject)(PlayObject.m_MyHero)).m_sCharName);
                        return;
                    }
                }
                if (sVariable == "$MAPNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$MAPNAME>", PlayObject.m_PEnvir.sMapDesc);
                    return;
                }
                if (sVariable == "$KILLER") // 杀人者变量
                {
                    if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                    {
                        if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                        {
                            sMsg = sub_49ADB8(sMsg, "<$KILLER>", PlayObject.m_LastHiter.m_sCharName);
                        }
                        else if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_HEROOBJECT))
                        {
                            if (PlayObject.m_LastHiter.m_Master != null)
                            {
                                sMsg = sub_49ADB8(sMsg, "<$KILLER>", PlayObject.m_LastHiter.m_Master.m_sCharName);
                            }
                            else
                            {
                                sMsg = sub_49ADB8(sMsg, "<$KILLER>", "未知");
                            }
                        }
                    }
                    else
                    {
                        sMsg = sub_49ADB8(sMsg, "<$KILLER>", "未知");
                    }
                    return;
                }
                if (sVariable == "$MONKILLER") // 杀人的怪物变量
                {
                    if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                    {
                        if ((PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_PLAYOBJECT) && (PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_HEROOBJECT))
                        {
                            sMsg = sub_49ADB8(sMsg, "<$MONKILLER>", PlayObject.m_LastHiter.m_sCharName);
                        }
                    }
                    else
                    {
                        sMsg = sub_49ADB8(sMsg, "<$MONKILLER>", "未知");
                    }
                    return;
                }
                if (sVariable == "$MAP")//增加地图ID参数
                {
                    sMsg = sub_49ADB8(sMsg, "<$MAP>", PlayObject.m_PEnvir.sMapName);
                    return;
                }
                if (sVariable == "$QUERYYBDEALLOG")
                {
                    // 查看元宝交易记录  20080318
                    sMsg = sub_49ADB8(sMsg, "<$QUERYYBDEALLOG>", PlayObject.SelectSellDate());
                    return;
                }
                if (sVariable == "$GUILDNAME")
                {
                    if (PlayObject.m_MyGuild != null)
                    {
                        sMsg = sub_49ADB8(sMsg, "<$GUILDNAME>", PlayObject.m_MyGuild.sGuildName);
                    }
                    else
                    {
                        sMsg = "无";
                    }
                    return;
                }
                if (sVariable == "$TAGMAPNAME1")
                {
                    // 记路标石记录地图名 20081019
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME1>", PlayObject.m_TagMapInfos[1].TagMapName);
                    return;
                }
                if (sVariable == "$TAGMAPNAME2")
                {
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME2>", PlayObject.m_TagMapInfos[2].TagMapName);
                    return;
                }
                if (sVariable == "$TAGMAPNAME3")
                {
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME3>", PlayObject.m_TagMapInfos[3].TagMapName);
                    return;
                }
                if (sVariable == "$TAGMAPNAME4")
                {
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME4>", PlayObject.m_TagMapInfos[4].TagMapName);
                    return;
                }
                if (sVariable == "$TAGMAPNAME5")
                {
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME5>", PlayObject.m_TagMapInfos[5].TagMapName);
                    return;
                }
                if (sVariable == "$TAGMAPNAME6")
                {
                    sMsg = sub_49ADB8(sMsg, "<$TAGMAPNAME6>", PlayObject.m_TagMapInfos[6].TagMapName);
                    return;
                }
                if (sVariable == "$TAGX1")
                {
                    // 记路标石记录X 20081019
                    sText = (PlayObject.m_TagMapInfos[1].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX1>", sText);
                    return;
                }
                if (sVariable == "$TAGX2")
                {
                    sText = (PlayObject.m_TagMapInfos[2].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX2>", sText);
                    return;
                }
                if (sVariable == "$TAGX3")
                {
                    sText = (PlayObject.m_TagMapInfos[3].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX3>", sText);
                    return;
                }
                if (sVariable == "$TAGX4")
                {
                    sText = (PlayObject.m_TagMapInfos[4].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX4>", sText);
                    return;
                }
                if (sVariable == "$TAGX5")
                {
                    sText = (PlayObject.m_TagMapInfos[5].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX5>", sText);
                    return;
                }
                if (sVariable == "$TAGX6")
                {
                    sText = (PlayObject.m_TagMapInfos[6].TagX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGX6>", sText);
                    return;
                }
                if (sVariable == "$TAGY1")
                {
                    // 记路标石记录Y 20081019
                    sText = (PlayObject.m_TagMapInfos[1].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY1>", sText);
                    return;
                }
                if (sVariable == "$TAGY2")
                {
                    sText = (PlayObject.m_TagMapInfos[2].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY2>", sText);
                    return;
                }
                if (sVariable == "$TAGY3")
                {
                    sText = (PlayObject.m_TagMapInfos[3].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY3>", sText);
                    return;
                }
                if (sVariable == "$TAGY4")
                {
                    sText = (PlayObject.m_TagMapInfos[4].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY4>", sText);
                    return;
                }
                if (sVariable == "$TAGY5")
                {
                    sText = (PlayObject.m_TagMapInfos[5].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY5>", sText);
                    return;
                }
                if (sVariable == "$TAGY6")
                {
                    sText = (PlayObject.m_TagMapInfos[6].TagY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$TAGY6>", sText);
                    return;
                }
                if (sVariable == "$GUILDMEMBERCOUNT")
                {
                    // 行会成员上限 20090115
                    if (PlayObject.m_MyGuild != null)
                    {
                        sText = (PlayObject.m_MyGuild.m_nGuildMemberCount).ToString();
                        sMsg = sub_49ADB8(sMsg, "<$GUILDMEMBERCOUNT>", sText);
                        return;
                    }
                }
                if (sVariable == "$GUILDFOUNTAIN")
                {
                    // 行会泉水仓库 20080625
                    if (PlayObject.m_MyGuild != null)
                    {
                        sText = (PlayObject.m_MyGuild.m_nGuildFountain).ToString();
                        sMsg = sub_49ADB8(sMsg, "<$GUILDFOUNTAIN>", sText);
                        return;
                    }
                }
                if (sVariable == "$ALCOHOL")
                {
                    // 酒量 20080627
                    sText = (PlayObject.m_Abil.MaxAlcohol).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$$ALCOHOL>", sText);
                    return;
                }
                if (sVariable == "$MEDICINEVALUE")
                {
                    // 药力值 20080627
                    sText = (PlayObject.m_Abil.MedicineValue).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MEDICINEVALUE>", sText);
                    return;
                }
                if (sVariable == "$RANKNAME")
                {
                    sMsg = sub_49ADB8(sMsg, "<$RANKNAME>", PlayObject.m_sGuildRankName);
                    return;
                }
                if (sVariable == "$LEVEL")
                {
                    sText = (PlayObject.m_Abil.Level).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$LEVEL>", sText);
                    return;
                }
                if (sVariable == "$USEGAMEGIRD")// 每次使用灵符数，$USEGAMEGIRD变量使用
                {
                    sText = (PlayObject.m_UseGameGird).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$USEGAMEGIRD>", sText);
                    return;
                }
                if (sVariable == "$BUYSHOP")// 每次商铺花的元宝数量
                {
                    sText = (PlayObject.m_BuyShopPrice).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$BUYSHOP>", sText);
                    return;
                }
                if (sVariable == "$GETCRYSTALEXP") // 天地结晶可提取的经验
                {
                    sText = (PlayObject.m_nGetCrystalExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GETCRYSTALEXP>", sText);
                    return;
                }
                if (sVariable == "$GETCRYSTALNGEXP")// 天地结晶可提取的内功经验
                {
                    sText = (PlayObject.m_nGetCrystalNGExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GETCRYSTALNGEXP>", sText);
                    return;
                }
                if (sVariable == "$CRYSTALEXP")// 天地结晶当前的经验
                {
                    sText = (PlayObject.m_CrystalExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$CRYSTALEXP>", sText);
                    return;
                }
                if (sVariable == "$CRYSTALNGEXP")// 天地结晶当前的内功经验
                {
                    sText = (PlayObject.m_CrystalNGExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$CRYSTALNGEXP>", sText);
                    return;
                }
                if (sVariable == "$CRYSTALLEVEL")// 天地结晶等级
                {
                    sText = (HUtil32._MIN(5, PlayObject.m_CrystalLevel)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$CRYSTALLEVEL>", sText);
                    return;
                }
                if (sVariable == "$GETEXP")
                {
                    // 人物取得的经验 20081228
                    sText = (PlayObject.m_GetExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GETEXP>", sText);
                    return;
                }
                if (sVariable == "$HEROGETEXP")
                {
                    // 英雄取得的经验 20081228
                    if (PlayObject.m_MyHero != null)
                    {
                        sText = (((THeroObject)(PlayObject.m_MyHero)).m_GetExp).ToString();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$HEROGETEXP>", sText);
                    return;
                }
                if (sVariable == "$GLORYPOINT")
                {
                    // 人物荣誉值  20080512
                    sText = (PlayObject.m_btGameGlory).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GLORYPOINT>", sText);
                    return;
                }
                if (sVariable == "$STATSERVERTIME")
                {
                    // 显示M2启动时间
                    //sText = svMain.FrmMain.LbRunTime.Text;
                    sMsg = sub_49ADB8(sMsg, "<$STATSERVERTIME>", sText);
                    return;
                }
                if (sVariable == "$RUNDATETIME")
                {
                    // 开区间隔时间
                    //sText = svMain.FrmMain.LbTimeCount.Text;
                    sMsg = sub_49ADB8(sMsg, "<$RUNDATETIME>", sText);
                    return;
                }
                if (sVariable == "$RANDOMNO")
                {
                    // 随机值变量
                    sText = (HUtil32.Random(Int32.MaxValue)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$RANDOMNO>", sText);
                    return;
                }
                if (sVariable == "$USERID")
                {
                    // 登录账号
                    sText = PlayObject.m_sUserID;
                    sMsg = sub_49ADB8(sMsg, "<$USERID>", sText);
                    return;
                }
                if (sVariable == "$IPADDR")
                {
                    // 登录IP
                    sText = PlayObject.m_sIPaddr;
                    sMsg = sub_49ADB8(sMsg, "<$IPADDR>", sText);
                    return;
                }
                if (sVariable == "$X")
                {
                    // 人物X坐标
                    sText = (PlayObject.m_nCurrX).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$X>", sText);
                    return;
                }
                if (sVariable == "$Y")
                {
                    // 人物Y坐标
                    sText = (PlayObject.m_nCurrY).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$Y>", sText);
                    return;
                }
                if (sVariable == "$HP")
                {
                    sText = (PlayObject.m_WAbil.HP).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$HP>", sText);
                    return;
                }
                if (sVariable == "$MAXHP")
                {
                    sText = (PlayObject.m_WAbil.MaxHP).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXHP>", sText);
                    return;
                }
                if (sVariable == "$MP")
                {
                    sText = (PlayObject.m_WAbil.MP).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MP>", sText);
                    return;
                }
                if (sVariable == "$MAXMP")
                {
                    sText = (PlayObject.m_WAbil.MaxMP).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXMP>", sText);
                    return;
                }
                if (sVariable == "$AC")
                {
                    sText = (HUtil32.LoWord(PlayObject.m_WAbil.AC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$AC>", sText);
                    return;
                }
                if (sVariable == "$MAXAC")
                {
                    sText = (HUtil32.HiWord(PlayObject.m_WAbil.AC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXAC>", sText);
                    return;
                }
                if (sVariable == "$MAC")
                {
                    sText = (HUtil32.LoWord(PlayObject.m_WAbil.MAC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAC>", sText);
                    return;
                }
                if (sVariable == "$MAXMAC")
                {
                    sText = (HUtil32.HiWord(PlayObject.m_WAbil.MAC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXMAC>", sText);
                    return;
                }
                if (sVariable == "$DC")
                {

                    sText = (HUtil32.LoWord(PlayObject.m_WAbil.DC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$DC>", sText);
                    return;
                }
                if (sVariable == "$MAXDC")
                {
                    sText = (HUtil32.HiWord(PlayObject.m_WAbil.DC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXDC>", sText);
                    return;
                }
                if (sVariable == "$MC")
                {

                    sText = (HUtil32.LoWord(PlayObject.m_WAbil.MC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MC>", sText);
                    return;
                }
                if (sVariable == "$MAXMC")
                {

                    sText = (HUtil32.HiWord(PlayObject.m_WAbil.MC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXMC>", sText);
                    return;
                }
                if (sVariable == "$SC")
                {

                    sText = (HUtil32.LoWord(PlayObject.m_WAbil.SC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$SC>", sText);
                    return;
                }
                if (sVariable == "$MAXSC")
                {

                    sText = (HUtil32.HiWord(PlayObject.m_WAbil.SC)).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXSC>", sText);
                    return;
                }
                if (sVariable == "$EXP")
                {
                    sText = (PlayObject.m_Abil.Exp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$EXP>", sText);
                    return;
                }
                if (sVariable == "$MAXEXP")
                {
                    sText = (PlayObject.m_Abil.MaxExp).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXEXP>", sText);
                    return;
                }
                if (sVariable == "$PKPOINT")
                {
                    sText = (PlayObject.m_nPkPoint).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$PKPOINT>", sText);
                    return;
                }
                if (sVariable == "$CREDITPOINT")
                {
                    sText = (PlayObject.m_btCreditPoint).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$CREDITPOINT>", sText);
                    return;
                }
                if (sVariable == "$HW")
                {
                    sText = (PlayObject.m_WAbil.HandWeight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$HW>", sText);
                    return;
                }
                if (sVariable == "$MAXHW")
                {
                    sText = (PlayObject.m_WAbil.MaxHandWeight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXHW>", sText);
                    return;
                }
                if (sVariable == "$BW")
                {
                    sText = (PlayObject.m_WAbil.Weight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$BW>", sText);
                    return;
                }
                if (sVariable == "$MAXBW")
                {
                    sText = (PlayObject.m_WAbil.MaxWeight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXBW>", sText);
                    return;
                }
                if (sVariable == "$WW")
                {
                    sText = (PlayObject.m_WAbil.WearWeight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$WW>", sText);
                    return;
                }
                if (sVariable == "$MAXWW")
                {
                    sText = (PlayObject.m_WAbil.MaxWearWeight).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$MAXWW>", sText);
                    return;
                }
                if (sVariable == "$GOLDCOUNT")
                {
                    sText = (PlayObject.m_nGold).ToString() + "/" + (PlayObject.m_nGoldMax).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GOLDCOUNT>", sText);
                    return;
                }
                if (sVariable == "$GAMEGOLD")
                {
                    sText = (PlayObject.m_nGameGold).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GAMEGOLD>", sText);
                    return;
                }
                if (sVariable == "$GAMEDIAMOND")
                {
                    sText = (PlayObject.m_nGAMEDIAMOND).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GAMEDIAMOND>", sText);
                    return;
                }
                if (sVariable == "$GAMEGIRD")
                {
                    sText = (PlayObject.m_nGAMEGIRD).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GAMEGIRD>", sText);
                    return;
                }
                if (sVariable == "$GAMEPOINT")
                {
                    sText = (PlayObject.m_nGamePoint).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$GAMEPOINT>", sText);
                    return;
                }
                if (sVariable == "$HUNGER")
                {
                    sText = (PlayObject.GetMyStatus()).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$HUNGER>", sText);
                    return;
                }
                if (sVariable == "$LOGINTIME")
                {
                    sText = (PlayObject.m_dLogonTime).ToString();
                    sMsg = sub_49ADB8(sMsg, "<$LOGINTIME>", sText);
                    return;
                }
                if (sVariable == "$LOGINLONG")
                {
                    sText = ((HUtil32.GetTickCount() - PlayObject.m_dwLogonTick) / 60000).ToString() + "分钟";
                    sMsg = sub_49ADB8(sMsg, "<$LOGINLONG>", sText);
                    return;
                }
                if (sVariable == "$DRESS")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$DRESS>", sText);
                    return;
                }
                else if (sVariable == "$WEAPON")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$WEAPON>", sText);
                    return;
                }
                else if (sVariable == "$RIGHTHAND")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RIGHTHAND]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$RIGHTHAND>", sText);
                    return;
                }
                else if (sVariable == "$HELMET")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$HELMET>", sText);
                    return;
                }
                else if (sVariable == "$ZHULI")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$ZHULI>", sText);
                    return;
                }
                else if (sVariable == "$NECKLACE")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$NECKLACE>", sText);
                    return;
                }
                else if (sVariable == "$RING_R")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$RING_R>", sText);
                    return;
                }
                else if (sVariable == "$RING_L")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$RING_L>", sText);
                    return;
                }
                else if (sVariable == "$ARMRING_R")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$ARMRING_R>", sText);
                    return;
                }
                else if (sVariable == "$ARMRING_L")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$ARMRING_L>", sText);
                    return;
                }
                else if (sVariable == "$BUJUK")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$BUJUK>", sText);
                    return;
                }
                else if (sVariable == "$BELT")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BELT]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$BELT>", sText);
                    return;
                }
                else if (sVariable == "$BOOTS")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$BOOTS>", sText);
                    return;
                }
                else if (sVariable == "$CHARM")
                {
                    sText = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex);
                    sMsg = sub_49ADB8(sMsg, "<$CHARM>", sText);
                    return;
                }
                else if (sVariable == "$IPADDR")
                {
                    sText = PlayObject.m_sIPaddr;
                    sMsg = sub_49ADB8(sMsg, "<$IPADDR>", sText);
                    return;
                }
                else if (sVariable == "$IPLOCAL")
                {
                    sText = PlayObject.m_sIPLocal;
                    // GetIPLocal(PlayObject.m_sIPaddr);
                    sMsg = sub_49ADB8(sMsg, "<$IPLOCAL>", sText);
                    return;
                }
                else if (sVariable == "$GUILDBUILDPOINT")
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        sText = "无";
                    }
                    else
                    {
                        sText = (PlayObject.m_MyGuild.nBuildPoint).ToString();
                    }
                    sMsg = sub_49ADB8(sMsg, "<$GUILDBUILDPOINT>", sText);
                    return;
                }
                else if (sVariable == "$GUILDAURAEPOINT")
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        sText = "无";
                    }
                    else
                    {
                        sText = (PlayObject.m_MyGuild.nAurae).ToString();
                    }
                    sMsg = sub_49ADB8(sMsg, "<$GUILDAURAEPOINT>", sText);
                    return;
                }
                else if (sVariable == "$GUILDSTABILITYPOINT")
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        sText = "无";
                    }
                    else
                    {
                        sText = (PlayObject.m_MyGuild.nStability).ToString();
                    }
                    sMsg = sub_49ADB8(sMsg, "<$GUILDSTABILITYPOINT>", sText);
                    return;
                }
                if (sVariable == "$GUILDFLOURISHPOINT")
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        sText = "无";
                    }
                    else
                    {
                        sText = (PlayObject.m_MyGuild.nFlourishing).ToString();
                    }
                    sMsg = sub_49ADB8(sMsg, "<$GUILDFLOURISHPOINT>", sText);
                    return;
                }
                // 其它信息
                if (sVariable == "$REQUESTCASTLEWARITEM")
                {
                    sText = M2Share.g_Config.sZumaPiece;
                    sMsg = sub_49ADB8(sMsg, "<$REQUESTCASTLEWARITEM>", sText);
                    return;
                }
                if (sVariable == "$REQUESTCASTLEWARDAY")
                {
                    sText = M2Share.g_Config.sZumaPiece;
                    sMsg = sub_49ADB8(sMsg, "<$REQUESTCASTLEWARDAY>", sText);
                    return;
                }
                if (sVariable == "$REQUESTBUILDGUILDITEM")
                {
                    sText = M2Share.g_Config.sWomaHorn;
                    sMsg = sub_49ADB8(sMsg, "<$REQUESTBUILDGUILDITEM>", sText);
                    return;
                }
                if (sVariable == "$OWNERGUILD")
                {
                    if (this.m_Castle != null)
                    {
                        sText = this.m_Castle.m_sOwnGuild;
                        if (sText == "")
                        {
                            sText = "游戏管理";
                        }
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$OWNERGUILD>", sText);
                    return;
                }
                if (sVariable == "$CASTLENAME")
                {
                    if (this.m_Castle != null)
                    {
                        sText = this.m_Castle.m_sName;
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$CASTLENAME>", sText);
                    return;
                }
                if (sVariable == "$LORD")
                {
                    if (this.m_Castle != null)
                    {
                        if (this.m_Castle.m_MasterGuild != null)
                        {
                            sText = this.m_Castle.m_MasterGuild.GetChiefName();
                        }
                        else
                        {
                            sText = "管理员";
                        }
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$LORD>", sText);
                    return;
                }
                if (sVariable == "$GUILDWARFEE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$GUILDWARFEE>", (M2Share.g_Config.nGuildWarPrice).ToString());
                    return;
                }
                if (sVariable == "$BUILDGUILDFEE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$BUILDGUILDFEE>", (M2Share.g_Config.nBuildGuildPrice).ToString());
                    return;
                }
                if (sVariable == "$CASTLEWARDATE")
                {
                    if (this.m_Castle == null)
                    {
                        this.m_Castle = M2Share.g_CastleManager.GetCastle(0);
                    }
                    if (this.m_Castle != null)
                    {
                        if (!this.m_Castle.m_boUnderWar)
                        {
                            sText = this.m_Castle.GetWarDate();
                            if (sText != "")
                            {
                                sMsg = sub_49ADB8(sMsg, "<$CASTLEWARDATE>", sText);
                            }
                            else
                            {
                                sMsg = "暂时没有行会攻城！！！\\ \\<返回/@main>";
                            }
                        }
                        else
                        {
                            sMsg = "现正在攻城中！！！\\ \\<返回/@main>";
                        }
                    }
                    else
                    {
                        sText = "????";
                    }
                    return;
                }
                if (sVariable == "$LISTOFWAR")
                {
                    if (this.m_Castle != null)
                    {
                        sText = this.m_Castle.GetAttackWarList();
                    }
                    else
                    {
                        sText = "????";
                    }
                    if (sText != "")
                    {
                        sMsg = sub_49ADB8(sMsg, "<$LISTOFWAR>", sText);
                    }
                    else
                    {
                        sMsg = "现在没有行会申请攻城战\\ \\<返回/@main>";
                    }
                    return;
                }
                if (sVariable == "$CASTLECHANGEDATE")
                {
                    if (this.m_Castle != null)
                    {
                        sText = this.m_Castle.m_ChangeDate.ToString();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$CASTLECHANGEDATE>", sText);
                    return;
                }
                if (sVariable == "$CASTLEWARLASTDATE")
                {
                    if (this.m_Castle != null)
                    {
                        sText = this.m_Castle.m_WarDate.ToString();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$CASTLEWARLASTDATE>", sText);
                    return;
                }
                if (sVariable == "$CASTLEGETDAYS")
                {
                    if (this.m_Castle != null)
                    {
                        sText = HUtil32.GetDayCount(DateTime.Now, this.m_Castle.m_ChangeDate).ToString();
                    }
                    else
                    {
                        sText = "????";
                    }
                    sMsg = sub_49ADB8(sMsg, "<$CASTLEGETDAYS>", sText);
                    return;
                }
                if (sVariable == "$CMD_DATE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_DATE>", M2Share.g_GameCommand.Data.sCmd);
                    return;
                }
                if (sVariable == "$CMD_ALLOWMSG")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_ALLOWMSG>", M2Share.g_GameCommand.ALLOWMSG.sCmd);
                    return;
                }
                if (sVariable == "$CMD_LETSHOUT")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_LETSHOUT>", M2Share.g_GameCommand.LETSHOUT.sCmd);
                    return;
                }
                if (sVariable == "$CMD_LETTRADE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_LETTRADE>", M2Share.g_GameCommand.LETTRADE.sCmd);
                    return;
                }
                if (sVariable == "$CMD_LETGUILD")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_LETGUILD>", M2Share.g_GameCommand.LETGUILD.sCmd);
                    return;
                }
                if (sVariable == "$CMD_ENDGUILD")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_ENDGUILD>", M2Share.g_GameCommand.ENDGUILD.sCmd);
                    return;
                }
                if (sVariable == "$CMD_BANGUILDCHAT")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_BANGUILDCHAT>", M2Share.g_GameCommand.BANGUILDCHAT.sCmd);
                    return;
                }
                if (sVariable == "$CMD_AUTHALLY")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_AUTHALLY>", M2Share.g_GameCommand.AUTHALLY.sCmd);
                    return;
                }
                if (sVariable == "$CMD_AUTH")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_AUTH>", M2Share.g_GameCommand.AUTH.sCmd);
                    return;
                }
                if (sVariable == "$CMD_AUTHCANCEL")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_AUTHCANCEL>", M2Share.g_GameCommand.AUTHCANCEL.sCmd);
                    return;
                }
                if (sVariable == "$CMD_USERMOVE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_USERMOVE>", M2Share.g_GameCommand.USERMOVE.sCmd);
                    return;
                }
                if (sVariable == "$CMD_SEARCHING")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_SEARCHING>", M2Share.g_GameCommand.SEARCHING.sCmd);
                    return;
                }
                if (sVariable == "$CMD_ALLOWGROUPCALL")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_ALLOWGROUPCALL>", M2Share.g_GameCommand.ALLOWGROUPCALL.sCmd);
                    return;
                }
                if (sVariable == "$CMD_GROUPRECALLL")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_GROUPRECALLL>", M2Share.g_GameCommand.GROUPRECALLL.sCmd);
                    return;
                }
                if (sVariable == "$CMD_ATTACKMODE")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_ATTACKMODE>", M2Share.g_GameCommand.ATTACKMODE.sCmd);
                    return;
                }
                if (sVariable == "$CMD_REST")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_REST>", M2Share.g_GameCommand.REST.sCmd);
                    return;
                }
                if (sVariable == "$CMD_STORAGESETPASSWORD")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_STORAGESETPASSWORD>", M2Share.g_GameCommand.SETPASSWORD.sCmd);
                    return;
                }
                if (sVariable == "$CMD_STORAGECHGPASSWORD")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_STORAGECHGPASSWORD>", M2Share.g_GameCommand.CHGPASSWORD.sCmd);
                    return;
                }
                if (sVariable == "$CMD_STORAGELOCK")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_STORAGELOCK>", M2Share.g_GameCommand.__Lock.sCmd);
                    return;
                }
                if (sVariable == "$CMD_STORAGEUNLOCK")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_STORAGEUNLOCK>", M2Share.g_GameCommand.UNLOCKSTORAGE.sCmd);
                    return;
                }
                if (sVariable == "$CMD_UNLOCK")
                {
                    sMsg = sub_49ADB8(sMsg, "<$CMD_UNLOCK>", M2Share.g_GameCommand.UnLock.sCmd);
                    return;
                }
                if (HUtil32.CompareLStr(sVariable, "$HUMAN(", 7))
                {
                    HUtil32.ArrestStringEx(sVariable, "(", ")", ref s14);
                    boFoundVar = false;
                    if (PlayObject.m_DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_DynamicVarList.Count; I++)
                        {
                            DynamicVar = PlayObject.m_DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((s14).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (DynamicVar.nInternet).ToString());
                                        boFoundVar = true;
                                        break;
                                    case TVarType.vString:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", DynamicVar.sString);
                                        boFoundVar = true;
                                        break;
                                }
                                break;
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        sMsg = "??";
                    }
                    return;
                }
                if (HUtil32.CompareLStr(sVariable, "$GUILD(", 7))
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        return;
                    }
                    HUtil32.ArrestStringEx(sVariable, "(", ")", ref s14);
                    boFoundVar = false;
                    if (PlayObject.m_MyGuild.m_DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < PlayObject.m_MyGuild.m_DynamicVarList.Count; I++)
                        {
                            DynamicVar = PlayObject.m_MyGuild.m_DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((s14).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (DynamicVar.nInternet).ToString());
                                        boFoundVar = true;
                                        break;
                                    case TVarType.vString:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", DynamicVar.sString);
                                        boFoundVar = true;
                                        break;
                                }
                                break;
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        sMsg = "??";
                    }
                    return;
                }
                if (HUtil32.CompareLStr(sVariable, "$GLOBAL(", 8))
                {
                    HUtil32.ArrestStringEx(sVariable, "(", ")", ref s14);
                    boFoundVar = false;
                    if (M2Share.g_DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < M2Share.g_DynamicVarList.Count; I++)
                        {
                            DynamicVar = M2Share.g_DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((s14).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (DynamicVar.nInternet).ToString());
                                        boFoundVar = true;
                                        break;
                                    case TVarType.vString:
                                        sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", DynamicVar.sString);
                                        boFoundVar = true;
                                        break;
                                }
                                break;
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        sMsg = "??";
                    }
                    return;
                }
                if (HUtil32.CompareLStr(sVariable, "$STR(", 5))
                {
                    HUtil32.ArrestStringEx(sVariable, "(", ")", ref s14);
                    n18 = M2Share.GetValNameNo(s14);
                    if (n18 >= 0)
                    {
                        if (n18 <= 99)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nVal[n18]).ToString());
                        }
                        else if (n18 >= 100 | n18 <= 199)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalVal[n18 - 100]).ToString());
                        }
                        else if (n18 >= 200 | n18 <= 299)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_DyVal[n18 - 200]).ToString());
                        }
                        else if (n18 >= 300 | n18 <= 399)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nMval[n18 - 300]).ToString());
                        }
                        else if (n18 >= 400 | n18 <= 499)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobaDyMval[n18 - 400]).ToString());
                        }
                        else if (n18 >= 500 | n18 <= 599)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nInteger[n18 - 500]).ToString());
                        }
                        else if (n18 >= 600 | n18 <= 699)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_sString[n18 - 600]).ToString());
                        }
                        else if (n18 >= 700 | n18 <= 799)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalAVal[n18 - 700]).ToString());
                        }
                        else if (n18 >= 800 | n18 <= 899)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalVal[n18 - 700]).ToString());
                        }
                        else if (n18 >= 1200 | n18 <= 1599)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalAVal[n18 - 1100]).ToString());
                        }
                        if (HUtil32.rangeInDefined(n18, 0, 99))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nVal[n18]).ToString());
                        }
                        else if(HUtil32.rangeInDefined(n18,100,199)) {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalVal[n18 - 100]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 200, 299))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_DyVal[n18 - 200]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 300, 399))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nMval[n18 - 300]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 400, 499))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobaDyMval[n18 - 400]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 500, 599))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (PlayObject.m_nInteger[n18 - 500]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 600, 699))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", PlayObject.m_sString[n18 - 600]);
                        }
                        else if (HUtil32.rangeInDefined(n18, 700, 799))
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", M2Share.g_Config.GlobalAVal[n18 - 700]);
                        }
                        else if (HUtil32.rangeInDefined(n18, 800, 1199)) // G变量(100-499)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", (M2Share.g_Config.GlobalVal[n18 - 700]).ToString());
                        }
                        else if (HUtil32.rangeInDefined(n18, 1200, 1599)) // A变量(100-499)
                        {
                            sMsg = sub_49ADB8(sMsg, "<" + sVariable + ">", M2Share.g_Config.GlobalAVal[n18 - 1100]);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.GetVariableText");
            }
        }

        public bool GotoLable_CheckQuestStatus(TPlayObject PlayObject, TScript ScriptInfo)
        {
            bool result = true;
            int I = 0;
            if (!ScriptInfo.boQuest)
            {
                return result;
            }
            while (true)
            {
                if ((ScriptInfo.QuestInfo[I].nRandRage > 0) && (HUtil32.Random(ScriptInfo.QuestInfo[I].nRandRage) != 0))
                {
                    result = false;
                    break;
                }
                if (PlayObject.GetQuestFalgStatus(ScriptInfo.QuestInfo[I].wFlag) != ScriptInfo.QuestInfo[I].btValue)
                {
                    result = false;
                    break;
                }
                I++;
                if (I >= 10)
                {
                    break;
                }
            }
            return result;
        }

        public unsafe TUserItem* GotoLable_CheckItemW(TPlayObject PlayObject, string sItemType, int nParam)
        {
            TUserItem* result;
            int nCount = 0;
            result = null;
            if (HUtil32.CompareLStr(sItemType, "[NECKLACE]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_NECKLACE];
                }
                return result;
            }
            if (HUtil32.CompareLStr(sItemType, "[RING]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_RINGL];
                }
                return result;
            }
            if (HUtil32.CompareLStr(sItemType, "[ARMRING]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_ARMRINGR];
                }
                return result;
            }
            if (HUtil32.CompareLStr(sItemType, "[WEAPON]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_WEAPON];
                }
                return result;
            }
            if (HUtil32.CompareLStr(sItemType, "[HELMET]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_HELMET];
                }
                return result;
            }
            if (HUtil32.CompareLStr(sItemType, "[ZHULI]", 4))// 斗笠
            {
                if (PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex > 0)
                {
                    result = PlayObject.m_UseItems[TPosition.U_ZHULI];
                }
                return result;
            }
            result = PlayObject.sub_4C4CD4(sItemType, ref nCount);
            if (nCount < nParam)
            {
                result = null;
            }
            return result;
        }

        public bool GotoLable_CheckAnsiContainsTextList(string sTest, string sListFileName)
        {
            bool result = false;
            TStringList LoadList;
            result = false;
            sListFileName = M2Share.g_Config.sEnvirDir + sListFileName;
            if (File.Exists(sListFileName))
            {
                LoadList = new TStringList();
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败.... => " + sListFileName);
                }
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        if ((sTest.IndexOf(LoadList[I].Trim()) != -1))
                        {
                            result = true;
                            break;
                        }
                    }
                }

                Dispose(LoadList);
            }
            else
            {
                M2Share.MainOutMessage("文件没有找到 => " + sListFileName);
            }
            return result;
        }

        /// <summary>
        /// 功能:检查文本里是否含有指定的字符串
        /// </summary>
        /// <param name="sTest"></param>
        /// <param name="sListFileName"></param>
        /// <returns></returns>
        public bool GotoLable_CheckTextInList(string sTest, string sListFileName)
        {
            bool result = false;
            TStringList LoadList;
            result = false;
            sListFileName = M2Share.g_Config.sEnvirDir + sListFileName;
            if (File.Exists(sListFileName))
            {
                LoadList = new TStringList();
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败 => " + sListFileName);
                }
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        if ((LoadList[I].Trim().IndexOf(sTest) != -1))
                        {
                            result = true;
                            break;
                        }
                    }
                }

                Dispose(LoadList);
            }
            else
            {
                M2Share.MainOutMessage("文件没有找到 => " + sListFileName);
            }
            return result;
        }

        public bool GotoLable_CheckStringList(string sHumName, string sListFileName)
        {
            bool result = false;
            TStringList LoadList;
            result = false;
            sListFileName = M2Share.g_Config.sEnvirDir + sListFileName;
            if (File.Exists(sListFileName))
            {
                LoadList = new TStringList();
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败 => " + sListFileName);
                }
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        if ((LoadList[I].Trim()).ToLower().CompareTo((sHumName).ToLower()) == 0)
                        {
                            result = true;
                            break;
                        }
                    }
                }

                Dispose(LoadList);
            }
            else
            {
                M2Share.MainOutMessage("文件没有找到 => " + sListFileName);
            }
            return result;
        }

        public bool GotoLable_CheckVarNameNo_GetValValue(TPlayObject PlayObject, string sValName, ref int nValue)
        {
            bool result = false;
            int n100;
            result = false;
            nValue = 0;
            n100 = M2Share.GetValNameNo(sValName);
            if (n100 >= 0)
            {
                if (HUtil32.rangeInDefined(n100, 0, 99))
                {
                    nValue = PlayObject.m_nVal[n100];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 100, 199))
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 100];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 200, 299))
                {
                    nValue = PlayObject.m_DyVal[n100 - 200];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 300, 399))
                {
                    nValue = PlayObject.m_nMval[n100 - 300];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 400, 499))
                {
                    nValue = M2Share.g_Config.GlobaDyMval[n100 - 400];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 500, 599))
                {
                    nValue = PlayObject.m_nInteger[n100 - 500];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 600, 699))
                {
                    if (HUtil32.IsStringNumber(PlayObject.m_sString[n100 - 600]))
                    {
                        nValue = HUtil32.Str_ToInt(PlayObject.m_sString[n100 - 600], 0);
                        result = true;
                    }
                }
                else if (HUtil32.rangeInDefined(n100, 700, 799))
                {
                    if (HUtil32.IsStringNumber(M2Share.g_Config.GlobalAVal[n100 - 700]))
                    {
                        nValue = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n100 - 700], 0);
                        result = true;
                    }
                }
                else if (HUtil32.rangeInDefined(n100, 800, 1199))//G变量
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 700];
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 1200, 1599))//A变量
                {
                    if (HUtil32.IsStringNumber(M2Share.g_Config.GlobalAVal[n100 - 1100]))
                    {
                        nValue = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n100 - 1100], 0);
                        result = true;
                    }
                }
            }
            return result;
        }

        public bool GotoLable_CheckVarNameNo_GetDynamicVarValue(TPlayObject PlayObject, string sVarType, string sValName, ref int nValue)
        {
            bool result = false;
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            result = false;
            DynamicVarList = GetDynamicVarList(PlayObject, sVarType, ref sName);
            if (DynamicVarList == null)
            {
                return result;
            }
            else
            {
                if (DynamicVarList.Count > 0)
                {
                    for (int i = 0; i < DynamicVarList.Count; i++)
                    {
                        DynamicVar = DynamicVarList[i];
                        if (DynamicVar != null)
                        {
                            if ((DynamicVar.sName).ToLower().CompareTo((sValName).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        nValue = DynamicVar.nInternet;
                                        result = true;
                                        break;
                                    case TVarType.vString:
                                        break;
                                }
                                break;
                            }
                        }
                    }
                }
            }
            return result;
        }

        /// <summary>
        /// 取变量类型
        /// </summary>
        /// <param name="CheckQuestConditionInfo"></param>
        /// <returns></returns>
        public int GotoLable_CheckVarNameNo_GetDataType(TQuestConditionInfo CheckQuestConditionInfo)
        {
            int result = -1;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = CheckQuestConditionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = CheckQuestConditionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = CheckQuestConditionInfo.sParam3;
            }
            if (HUtil32.IsVarNumber(sParam1))
            {
                if ((sParam3 != "") && (M2Share.GetValNameNo(sParam3) >= 0))
                {
                    result = 0;
                }
                else if ((sParam3 != "") && HUtil32.IsStringNumber(sParam3))
                {
                    result = 1;
                }
                return result;
            }
            if (M2Share.GetValNameNo(sParam1) >= 0)
            {
                if ((sParam2 != "") && (M2Share.GetValNameNo(sParam2) >= 0))
                {
                    result = 2;
                }
                else if ((sParam2 != "") && HUtil32.IsVarNumber(sParam2) && (sParam3 != ""))
                {
                    result = 3;
                }
                else if ((sParam2 != "") && HUtil32.IsStringNumber(sParam2))
                {
                    result = 4;
                }
            }
            return result;
        }

        public bool GotoLable_CheckVarNameNo(TQuestConditionInfo CheckQuestConditionInfo, TPlayObject PlayObject, ref int n140, ref int n180)
        {
            bool result = false;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            result = false;
            n140 = -1;
            n180 = -1;
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = CheckQuestConditionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = CheckQuestConditionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(CheckQuestConditionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(CheckQuestConditionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = CheckQuestConditionInfo.sParam3;
            }
            switch (GotoLable_CheckVarNameNo_GetDataType(CheckQuestConditionInfo))
            {
                case 0:
                    if (GotoLable_CheckVarNameNo_GetDynamicVarValue(PlayObject, sParam1, sParam2, ref n140) && GotoLable_CheckVarNameNo_GetValValue(PlayObject, sParam3, ref n180))
                    {
                        result = true;
                    }
                    break;
                case 1:
                    n180 = CheckQuestConditionInfo.nParam3;
                    if (GotoLable_CheckVarNameNo_GetDynamicVarValue(PlayObject, sParam1, sParam2, ref n140))
                    {
                        result = true;
                    }
                    break;
                case 2:
                    if (GotoLable_CheckVarNameNo_GetValValue(PlayObject, sParam1, ref n140) && GotoLable_CheckVarNameNo_GetValValue(PlayObject, sParam2, ref n180))
                    {
                        result = true;
                    }
                    break;
                case 3:
                    if (GotoLable_CheckVarNameNo_GetValValue(PlayObject, sParam1, ref n140) && GotoLable_CheckVarNameNo_GetDynamicVarValue(PlayObject, sParam2, sParam3, ref n180))
                    {
                        result = true;
                    }
                    break;
                case 4:
                    n180 = CheckQuestConditionInfo.nParam2;
                    if (GotoLable_CheckVarNameNo_GetValValue(PlayObject, sParam1, ref n140))
                    {
                        result = true;
                    }
                    break;
                case 5:
                    break;
            }
            return result;
        }

        /// <summary>
        /// 脚本执行所需条件处理
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="UserItem"></param>
        /// <param name="ConditionList"></param>
        /// <returns></returns>
        public unsafe bool QuestCheckCondition(TPlayObject PlayObject, TUserItem* UserItem, IList<TQuestConditionInfo> ConditionList)
        {
            bool result = true;
            int n10 = 0;
            int n14 = 0;
            int n18 = 0;
            int n1C = 0;
            int nMaxDura = 0;
            int nDura = 0;
            int Hour = 0;
            int Min = 0;
            int Sec = 0;
            int MSec = 0;
            TStdItem StdItem;
            string s01 = string.Empty;
            string s02 = string.Empty;
            string SC = string.Empty;
            if (ConditionList.Count > 0)
            {
                foreach (var QuestConditionInfo in ConditionList)
                {
                    switch (QuestConditionInfo.nCMDCode)
                    {
                        case M2Share.nDAYTIME:
                            if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("SUNRAISE").ToLower()) == 0)
                            {
                                if (M2Share.g_nGameTime != 0)
                                {
                                    result = false;
                                }
                            }
                            if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("DAY").ToLower()) == 0)
                            {
                                if (M2Share.g_nGameTime != 1)
                                {
                                    result = false;
                                }
                            }
                            if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("SUNSET").ToLower()) == 0)
                            {
                                if (M2Share.g_nGameTime != 2)
                                {
                                    result = false;
                                }
                            }
                            if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("NIGHT").ToLower()) == 0)
                            {
                                if (M2Share.g_nGameTime != 3)
                                {
                                    result = false;
                                }
                            }
                            break;
                        case M2Share.nCHECKBBCOUNT:
                            if (PlayObject.m_SlaveList.Count < QuestConditionInfo.nParam1)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKITEMW:
                            UserItem = GotoLable_CheckItemW(PlayObject, QuestConditionInfo.sParam1, QuestConditionInfo.nParam2);
                            if (UserItem == null)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nISTAKEITEM:
                            if (SC != QuestConditionInfo.sParam1)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKDURAEVA:
                            UserItem = PlayObject.QuestCheckItem(QuestConditionInfo.sParam1, ref n1C, ref nMaxDura, ref nDura);
                            if (n1C > 0)
                            {
                                if (Convert.ToInt32(HUtil32.Round((double)nMaxDura / n1C / 1000)) < QuestConditionInfo.nParam2)
                                {
                                    result = false;
                                }
                            }
                            else
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKLUCKYPOINT:
                            if (PlayObject.m_nBodyLuckLevel < QuestConditionInfo.nParam1)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_ISATTACKALLYGUILD:
                            if (!ConditionOfCheckIsAttackAllyGuild(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKGAMEGOLD:
                            if (!ConditionOfCheckGameGold(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSTRINGLENGTH:
                            if (!ConditionOfCheckStringlength(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKGAMEGLORY:// 检测荣誉值 
                            if (!ConditionOfCheckGameGLORY(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSKILLLEVEL:// 检查技能等级 
                            if (!ConditionOfCHECKSKILLLEVEL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKMAPMOBCOUNT:// 检查地图指定坐标指定名称怪物数量 
                            if (!ConditionOfCHECKMAPMOBCOUNT(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSIDESLAVENAME:// 检查人物周围自己宝宝数量
                            if (!ConditionOfCHECKSIDESLAVENAME(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKCURRENTDATE:// 检测当前日期是否小于大于等于指定的日期
                            if (!ConditionOfCHECKCURRENTDATE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKMASTERONLINE:// 检测师傅（或徒弟）是否在线 
                            if (!ConditionOfCHECKMASTERONLINE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKDEARONLINE:// 检测夫妻一方是否在线 
                            if (!ConditionOfCHECKDEARONLINE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKMASTERONMAP:// 检测师傅（或徒弟）是否在XXX地图，支持SELF（是否同一地图） 
                            if (!ConditionOfCHECKMASTERONMAP(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKDEARONMAP:// 检测夫妻一方是否在XXX地图，支持SELF（是否同一地图）
                            if (!ConditionOfCHECKDEARONMAP(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPOSEISPRENTICE:// 检测对面是否为自己的徒弟 
                            if (!ConditionOfCHECKPOSEISPRENTICE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKCASTLEWAR:// 检查是否在攻城期间
                            if (!ConditionOfCHECKCASTLEWAR(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_FINDMAPPATH:// 设置地图的起终XY值
                            if (!ConditionOfFINDMAPPATH(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROLOYAL:// 检测英雄的忠诚度
                            if (!ConditionOfCHECKHEROLOYAL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nISONMAKEWINE:// 判断是否在酿哪种酒
                            if (!ConditionOfISONMAKEWINE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKGUILDFOUNTAIN:// 判断是否开启行会泉水仓库 
                            if (!ConditionOfCHECKGUILDFOUNTAIN(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPAYMENT:
                            if (!ConditionOfCheckPayMent(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_PASSWORDERRORCOUNT:
                            if (!ConditionOfCheckPasswordErrorCount(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_ISLOCKPASSWORD:
                            if (!ConditionOfIsLockPassword(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_ISLOCKSTORAGE:
                            if (!ConditionOfIsLockStorage(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_ISONMAP:// 检测地图命令 
                            if (!ConditionOfISONMAP(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKINMAPRANGE:
                            if (!ConditionOfCheckInMapRange(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHUMINRANGE:// 无忧加检测指定人物是否在指定地图范围之内。
                            if (!ConditionOfCheckHumInRange(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_MAPHUMISSAMEGUILD:// 检测当前地图中的人物是否属于同一个行会(所有人是同一行会才为真)
                            if (!ConditionOfMAPHUMISSAMEGUILD(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nHEROCHECKSKILL:
                            if (!ConditionOfHEROCHECKSKILL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKLISTTEXT:// 检查文件是否包含指定文本
                            s01 = QuestConditionInfo.sParam2;
                            if ((s01 != "") && (s01[0] == '<') && (s01[1] == '$'))
                            {
                                s01 = GetLineVariableText(PlayObject, QuestConditionInfo.sParam2);
                            }
                            else
                            {
                                GetValValue(PlayObject, QuestConditionInfo.sParam2, ref s01);
                            }
                            if (QuestConditionInfo.sParam1[0] == '\\')
                            {
                                s02 = QuestConditionInfo.sParam1.Substring(2 - 1, QuestConditionInfo.sParam1.Length - 1);
                            }
                            if (QuestConditionInfo.sParam1[0] == '\\')
                            {
                                s02 = QuestConditionInfo.sParam1.Substring(3 - 1, QuestConditionInfo.sParam1.Length - 2);
                            }
                            if (QuestConditionInfo.sParam1[2] == '\\')
                            {
                                s02 = QuestConditionInfo.sParam1.Substring(4 - 1, QuestConditionInfo.sParam1.Length - 3);
                            }
                            s02 = GetLineVariableText(PlayObject, s02);
                            if (!GotoLable_CheckTextInList(s01, s02))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_ISOFFLINEMODE:// 检测是否是离线挂机人物
                            if (!PlayObject.m_boNotOnlineAddExp)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSTATIONTIME:
                            if (!ConditionOfCheckStationTime(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSIGNMAP:// 检测人物站立时间
                            if (PlayObject.m_btLastOutStatus != 1)
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_HAVEHERO:// 检测最后退出状态
                            // =================================英雄相关=====================================
                            if (!ConditionOfCheckHasHero(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROONLINE:
                            if (!ConditionOfCheckHeroOnline(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROLEVEL:
                            if (!ConditionOfCheckHeroLevel(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKMINE:
                            if (!ConditionOfCHECKMINE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKONLINEPLAYCOUNT:// 检测矿纯度  20080324
                            if (!ConditionOfCHECKOnlinePlayCount(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPLAYDIELVL:
                        case M2Share.nSC_CHECKKILLPLAYLVL:
                            if (!ConditionOfCheckPlaylvl(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPLAYDIEJOB:
                        case M2Share.nSC_CHECKKILLPLAYJOB:
                            if (!ConditionOfCheckPlayJob(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPLAYDIESEX:
                        case M2Share.nSC_CHECKKILLPLAYSEX:
                            if (!ConditionOfCheckPlaySex(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKITEMLEVEL:// 检查装备升级次数
                            if (!ConditionOfCHECKITEMLEVEL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKMAKEWINE:// 检查酒的品质 
                            if (!ConditionOfCheckMakeWine(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROPKPOINT:// 检测英雄PK值
                            if (!ConditionOfCHECKHEROPKPOINT(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKCODELIST:// 检测文本里的编码是否存在 
                            if (!ConditionOfCHECKCODELIST(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKITEMSTATE:// 检查装备绑定状态 
                            if (!ConditionOfCHECKITEMSTATE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKITEMSNAME:// 检查指定装备位置是否带有指定的物品
                            if (!ConditionOfCHECKITEMSNAME(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKGUILDMEMBERCOUNT:// 检测行会成员上限
                            if (!ConditionOfCHECKGUILDMEMBERCOUNT(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKGUILDFOUNTAINVALUE:// 检测行会酒泉数
                            if (!ConditionOfCHECKGUILDFOUNTAINValue(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nCHECKNGLEVEL:// 检查角色内功等级
                            if (!ConditionOfCHECKNGLEVEL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nKILLBYHUM:// 检测是否被人物所杀
                            if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                            {
                                if ((PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_PLAYOBJECT) &&
                                    (PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_HEROOBJECT))
                                {
                                    result = false;
                                }
                            }
                            else
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nISHIGH:// 检测服务器最高属性人物命令
                            if (!ConditionOfISHIGH(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROJOB:
                            if (!ConditionOfCheckHeroJob(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHANGREADNG: // 检查是否学过内功
                            if (!ConditionOfCHANGREADNG(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKKIMNEEDLE:// 连击检测
                            if (!ConditionOfCHECKKIMNEEDLE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHUMANPULSE:
                            if (!ConditionOfCHECKHUMANPULSE(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKOPENPULSELEVEL:
                            if (!ConditionOfCHECKOPENPULSELEVEL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKPULSELEVEL:
                            if (!ConditionOfCHECKPULSELEVEL(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROOPENOPULS:
                            if (!ConditionOfCHECKHEROOPENOPULS(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKHEROPULSEXP:
                            if (!ConditionOfCHECKHEROPULSEXP(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CheckAssessMentHero:
                            // ----------双英雄命令------------------//
                            if (!ConditionOfCheckAssessMentHero(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CheckDeputyHero:
                            if (!ConditionOfCheckDeputyHero(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CheckHeroAutoPractice:
                            if (!ConditionOfCheckHeroAutoPractice(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKITMECOUNTDURA:// 检测持久物品命令
                            if (!ConditionOfCHECKITMECOUNTDURA(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                        case M2Share.nSC_CHECKSKILL75:
                            if (!ConditionOfCHECKSKILL75(PlayObject, QuestConditionInfo))
                            {
                                result = false;
                            }
                            break;
                    }
                    if (!result)
                    {
                        break;
                    }
                }
            }
            return result;
        }

        public bool GotoLable_JmpToLable(TPlayObject PlayObject, string sLabel)
        {
            bool result = false;
            PlayObject.m_nScriptGotoCount++;
            if (PlayObject.m_nScriptGotoCount > M2Share.g_Config.nScriptGotoCountLimit)
            {
                return result;
            }
            GotoLable(PlayObject, sLabel, false);
            result = true;
            return result;
        }

        public void GotoLable_GoToQuest(TPlayObject PlayObject, int nQuest)
        {
            TScript Script;
            if (m_ScriptList.Count > 0)
            {
                for (int I = 0; I < m_ScriptList.Count; I++)
                {
                    Script = m_ScriptList[I];
                    if (Script.nQuest == nQuest)
                    {
                        PlayObject.m_Script = Script;
                        PlayObject.m_NPC = this;
                        GotoLable(PlayObject, M2Share.sMAIN, false);
                        break;
                    }
                }
            }
        }

        public void GotoLable_AddList(string sHumName, string sListFileName)
        {
            TStringList LoadList;
            string s10;
            bool bo15;
            sListFileName = M2Share.g_Config.sEnvirDir + sListFileName;
            LoadList = new TStringList();
            try
            {
                if (File.Exists(sListFileName))
                {
                    try
                    {

                        LoadList.LoadFromFile(sListFileName);
                    }
                    catch
                    {
                        M2Share.MainOutMessage("文件读取失败 => " + sListFileName);
                    }
                }
                bo15 = false;
                if (LoadList.Count > 0)
                {
                    for (int I = 0; I < LoadList.Count; I++)
                    {
                        s10 = LoadList[I].Trim();
                        if ((sHumName).ToLower().CompareTo((s10).ToLower()) == 0)
                        {
                            bo15 = true;
                            break;
                        }
                    }
                }
                if (!bo15)
                {
                    LoadList.Add(sHumName);
                    try
                    {

                        LoadList.SaveToFile(sListFileName);
                    }
                    catch
                    {
                        M2Share.MainOutMessage("文件保存失败 => " + sListFileName);
                    }
                }
            }
            finally
            {
                Dispose(LoadList);
            }
        }

        public void GotoLable_DelList(string sHumName, string sListFileName)
        {
            TStringList LoadList;
            string s10;
            bool bo15;
            sListFileName = M2Share.g_Config.sEnvirDir + sListFileName;
            LoadList = new TStringList();
            if (File.Exists(sListFileName))
            {
                try
                {
                    LoadList.LoadFromFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件读取失败.... => " + sListFileName);
                }
            }
            bo15 = false;
            if (LoadList.Count > 0)
            {
                for (int I = 0; I < LoadList.Count; I++)
                {
                    if (LoadList.Count <= 0)
                    {
                        break;
                    }
                    s10 = LoadList[I].Trim();
                    if ((sHumName).ToLower().CompareTo((s10).ToLower()) == 0)
                    {
                        LoadList.RemoveAt(I);
                        bo15 = true;
                        break;
                    }
                }
            }
            if (bo15)
            {
                try
                {
                    LoadList.SaveToFile(sListFileName);
                }
                catch
                {
                    M2Share.MainOutMessage("文件保存失败 => " + sListFileName);
                }
            }

            Dispose(LoadList);
        }

        public unsafe void GotoLable_TakeItem(TPlayObject PlayObject, string sItemName, int nItemCount, string sVarNo, string sHero)
        {
            TUserItem* UserItem;
            TStdItem* StdItem;
            int nCount;
            string SC = string.Empty;
            string sName = string.Empty;
            if ((sHero).ToLower().CompareTo(("Hero").ToLower()) == 0)
            {
                if (PlayObject.m_MyHero != null)
                {
                    try
                    {
                        sName = GetLineVariableText(PlayObject, sItemName);
                        nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, sVarNo), 0);
                        if (nCount <= 0)
                        {
                            return;
                        }
                        if ((sName).ToLower().CompareTo((M2Share.sSTRING_GOLDNAME).ToLower()) == 0)
                        {
                            ((THeroObject)(PlayObject.m_MyHero)).DecGold(nCount);
                            ((THeroObject)(PlayObject.m_MyHero)).GoldChanged();
                            if (M2Share.g_boGameLogGold)
                            {
                                M2Share.AddGameDataLog("10" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() 
                                    + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" 
                                    + M2Share.sSTRING_GOLDNAME + "\09" + (nCount).ToString() + "\09" + "1" + "\09" + this.m_sCharName);
                            }
                            return;
                        }
                        try
                        {
                            for (int I = ((THeroObject)(PlayObject.m_MyHero)).m_ItemList.Count - 1; I >= 0; I--)
                            {
                                if (nCount <= 0)
                                {
                                    break;
                                }
                                if (((THeroObject)(PlayObject.m_MyHero)).m_ItemList.Count <= 0)
                                {
                                    break;
                                }
                                UserItem = (TUserItem*)((THeroObject)(PlayObject.m_MyHero)).m_ItemList[I];
                                if (UserItem == null)
                                {
                                    continue;
                                }
                                if ((UserEngine.GetStdItemName(UserItem->wIndex)).ToLower().CompareTo((sName).ToLower()) == 0)
                                {
                                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                    if (StdItem != null)
                                    {
                                        if (StdItem->NeedIdentify == 1)
                                        {
                                            M2Share.AddGameDataLog("10" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString() 
                                                + "\09" + PlayObject.m_sCharName + "\09" + sName + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() 
                                                + "/" + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() 
                                                + ")" + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() 
                                                + "/" + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")" 
                                                + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString()
                                                + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString()
                                                + "/" + (UserItem->btValue[8]).ToString() + "/" + (UserItem->btValue[14]).ToString() + "\09" + this.m_sCharName);
                                        }
                                        ((THeroObject)(PlayObject.m_MyHero)).m_ItemList.RemoveAt(I);
                                        ((THeroObject)(PlayObject.m_MyHero)).SendDelItems(UserItem);
                                        Marshal.FreeHGlobal((IntPtr)UserItem);
                                        nCount -= 1;
                                    }
                                }
                            }
                        }
                        catch
                        {
                            M2Share.MainOutMessage("{异常} TakeItem");
                        }
                    }
                    finally
                    {
                    }
                }
            }
            else
            {
                PlayObject.m_boCanQueryBag = true;// NPC操作物品时,不能刷新包裹
                try
                {
                    sName = GetLineVariableText(PlayObject, sItemName);
                    nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, sVarNo), 0);
                    if (nCount <= 0)
                    {
                        return;
                    }
                    if ((sName).ToLower().CompareTo((M2Share.sSTRING_GOLDNAME).ToLower()) == 0)
                    {
                        PlayObject.DecGold(nCount);
                        PlayObject.GoldChanged();
                        if (M2Share.g_boGameLogGold)
                        {
                            M2Share.AddGameDataLog("10" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() 
                                + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + M2Share.sSTRING_GOLDNAME 
                                + "\09" + (nCount).ToString() + "\09" + "1" + "\09" + this.m_sCharName);
                        }
                        return;
                    }
                    try
                    {
                        for (int I = PlayObject.m_ItemList.Count - 1; I >= 0; I--)
                        {
                            if (nCount <= 0)
                            {
                                break;
                            }
                            if (PlayObject.m_ItemList.Count <= 0)
                            {
                                break;
                            }
                            UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                            if (UserItem == null)
                            {
                                continue;
                            }
                            if ((UserEngine.GetStdItemName(UserItem->wIndex)).ToLower().CompareTo((sName).ToLower()) == 0)
                            {
                                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                if (StdItem != null)
                                {
                                    if (StdItem->NeedIdentify == 1)
                                    {
                                        M2Share.AddGameDataLog("10" + "\09" + PlayObject.m_sMapName + "\09" + PlayObject.m_nCurrX + "\09" +PlayObject.m_nCurrY + "\09" 
                                            + PlayObject.m_sCharName + "\09" + sName + "\09" + UserItem->MakeIndex + "\09" +
                                            "(" + HUtil32.LoWord(StdItem->DC) + "/" + HUtil32.HiWord(StdItem->DC) + ")" + "(" + HUtil32.LoWord(StdItem->MC) + "/" +
                                            HUtil32.HiWord(StdItem->MC) + ")" + "(" + HUtil32.LoWord(StdItem->SC) + "/" + HUtil32.HiWord(StdItem->SC) + ")" + "(" +
                                            HUtil32.LoWord(StdItem->AC) + "/" + HUtil32.HiWord(StdItem->AC) + ")" + "(" + HUtil32.LoWord(StdItem->MAC) + "/" +
                                            HUtil32.HiWord(StdItem->MAC) + ")" + (UserItem->btValue[0]).ToString() + "/" + UserItem->btValue[1] + "/" +
                                           UserItem->btValue[2] + "/" + UserItem->btValue[3] + "/" + UserItem->btValue[4] + "/" + UserItem->btValue[5] + "/" + UserItem->btValue[6]
                                            + "/" + UserItem->btValue[7] + "/" + UserItem->btValue[8] + "/" + UserItem->btValue[14] + "\09" + this.m_sCharName);
                                    }
                                    PlayObject.m_ItemList.RemoveAt(I);
                                    PlayObject.SendDelItems(UserItem);
                                    //SC = new string(HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen), 0, HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen)Len);
                                    Marshal.FreeHGlobal((IntPtr)UserItem);
                                    UserItem = null;
                                    nCount -= 1;
                                }
                            }
                        }
                    }
                    catch
                    {
                        M2Share.MainOutMessage("{异常} TakeItem");
                    }
                }
                finally
                {
                    PlayObject.m_boCanQueryBag = false;// NPC操作物品时,不能刷新包裹
                }
            }
        }

        public unsafe void GotoLable_TakeWItem(TPlayObject PlayObject, string sItemName, int nItemCount)
        {
            string sName = string.Empty;
            string SC;
            if (HUtil32.CompareLStr(sItemName, "[NECKLACE]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_NECKLACE]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[RING]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_RINGL]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex = 0;
                    return;
                }
                if (PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_RINGR]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[ARMRING]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_ARMRINGL]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex = 0;
                    return;
                }
                if (PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_ARMRINGR]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[WEAPON]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_WEAPON]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[HELMET]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_HELMET]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[ZHULI]", 4))// 斗笠
            {
                if (PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_ZHULI]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[DRESS]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_DRESS]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[U_BUJUK]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_BUJUK]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[U_BELT]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_BELT]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_BELT]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BELT]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_BELT]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[U_BOOTS]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_BOOTS]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex = 0;
                    return;
                }
            }
            if (HUtil32.CompareLStr(sItemName, "[U_CHARM]", 4))
            {
                if (PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex > 0)
                {
                    PlayObject.SendDelItems(PlayObject.m_UseItems[TPosition.U_CHARM]);
                    SC = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex);
                    PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex = 0;
                    return;
                }
            }
            for (int I = m_UseItems.GetLowerBound(0); I <= m_UseItems.GetUpperBound(0); I++)
            {
                if (nItemCount <= 0)
                {
                    return;
                }
                if (PlayObject.m_UseItems[I]->wIndex > 0)
                {
                    sName = UserEngine.GetStdItemName(PlayObject.m_UseItems[I]->wIndex);
                    if ((sName).ToLower().CompareTo((sItemName).ToLower()) == 0)
                    {
                        PlayObject.SendDelItems(PlayObject.m_UseItems[I]);
                        PlayObject.m_UseItems[I]->wIndex = 0;
                        nItemCount -= 1;
                    }
                }
            }
        }

        /// <summary>
        /// 取玩家变量
        /// </summary>
        /// <param name="PlayObject">当前玩家对象</param>
        /// <param name="sVariable">变量名称</param>
        /// <param name="sValue">字符串</param>
        /// <param name="nValue">整形</param>
        /// <param name="nDataType">变量类型 0 全局变量信息 1 个人变量信息</param>
        /// <returns>是否成功</returns>
        public unsafe bool GetHumanInfoValue(TPlayObject PlayObject, string sVariable, ref string sValue, ref int nValue, ref int nDataType)
        {
            bool result = false;
            string sMsg;
            string s10 = string.Empty;
            string sVarValue2 = string.Empty;
            int nSecond;
            TDynamicVar DynamicVar;
            int wHour;
            int wMinute;
            int wSecond;
            sValue = "";
            nValue = -1;
            nDataType = -1;
            result = false;
            if (sVariable == "")
            {
                return result;
            }
            sMsg = sVariable;
            HUtil32.ArrestStringEx(sMsg, "<", ">", ref s10);
            if (s10 == "")
            {
                return result;
            }
            sVariable = s10;
            if (sVariable == "$SERVERNAME")// 全局信息
            {
                sValue = M2Share.g_Config.sServerName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$SERVERIP")
            {
                sValue = M2Share.g_Config.sServerIPaddr;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$WEBSITE")
            {
                sValue = M2Share.g_Config.sWebSite;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BBSSITE")
            {
                sValue = M2Share.g_Config.sBbsSite;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$CLIENTDOWNLOAD")
            {
                sValue = M2Share.g_Config.sClientDownload;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$QQ")
            {
                sValue = M2Share.g_Config.sQQ;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$PHONE")
            {
                sValue = M2Share.g_Config.sPhone;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT0")
            {
                sValue = M2Share.g_Config.sBankAccount0;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT1")
            {
                sValue = M2Share.g_Config.sBankAccount1;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT2")
            {
                sValue = M2Share.g_Config.sBankAccount2;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT3")
            {
                sValue = M2Share.g_Config.sBankAccount3;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT4")
            {
                sValue = M2Share.g_Config.sBankAccount4;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT5")
            {
                sValue = M2Share.g_Config.sBankAccount5;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT6")
            {
                sValue = M2Share.g_Config.sBankAccount6;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT7")
            {
                sValue = M2Share.g_Config.sBankAccount7;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT8")
            {
                sValue = M2Share.g_Config.sBankAccount8;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$BANKACCOUNT9")
            {
                sValue = M2Share.g_Config.sBankAccount9;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEGOLDNAME")
            {
                sValue = M2Share.g_Config.sGameGoldName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEDIAMONDNAME")
            {
                sValue = M2Share.g_Config.sGameDiaMond;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEGIRDNAME")
            {
                sValue = M2Share.g_Config.sGameGird;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEPOINTNAME")
            {
                sValue = M2Share.g_Config.sGamePointName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$USERCOUNT")
            {
                sValue = (UserEngine.PlayObjectCount).ToString();
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$MACRUNTIME")
            {
                sValue = (HUtil32.GetTickCount() / 86400000).ToString(); // (24 * 60 * 60 * 1000)
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$SERVERRUNTIME")
            {
                nSecond = Convert.ToInt32((HUtil32.GetTickCount() - M2Share.g_dwStartTick) / 1000);
                wHour = nSecond / 3600;
                wMinute = (nSecond / 60) % 60;
                wSecond = nSecond % 60;
                sValue = string.Format("%d:%d:%d", wHour, wMinute, wSecond);
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$DATETIME")
            {
                // sValue = FormatDateTime("dddddd,dddd,hh:mm:nn", DateTime.Now);
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$USERNAME") // 个人信息
            {
                sValue = PlayObject.m_sCharName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$KILLER") // 杀人者变量
            {
                if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                {
                    if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_PLAYOBJECT))
                    {
                        sValue = PlayObject.m_LastHiter.m_sCharName;
                    }
                    else if ((PlayObject.m_LastHiter.m_btRaceServer == Grobal2.RC_HEROOBJECT))
                    {
                        if (PlayObject.m_LastHiter.m_Master != null)
                        {
                            sValue = PlayObject.m_LastHiter.m_Master.m_sCharName;
                        }
                        else
                        {
                            sValue = "未知";
                        }
                    }
                }
                else
                {
                    sValue = "未知";
                }
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$MONKILLER") // 杀人的怪物变量
            {
                if (PlayObject.m_boDeath && (PlayObject.m_LastHiter != null))
                {
                    if ((PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_PLAYOBJECT) && (PlayObject.m_LastHiter.m_btRaceServer != Grobal2.RC_HEROOBJECT))
                    {
                        sValue = PlayObject.m_LastHiter.m_sCharName;
                    }
                }
                else
                {
                    sValue = "未知";
                }
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$USERALLNAME") // 全名 
            {
                sValue = PlayObject.GetShowName();
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$SFNAME") // 师傅名 
            {
                sValue = PlayObject.m_sMasterName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$STATSERVERTIME")
            {
                // 显示M2启动时间
                //sValue = svMain.Units.svMain.FrmMain.LbRunTime.Text;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$RUNDATETIME") // 开区间隔时间
            {
                //sValue = svMain.FrmMain.LbTimeCount.Text;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$RANDOMNO") // 随机值变量
            {
                nValue = HUtil32.Random(Int32.MaxValue);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$USERID") // 登录账号
            {
                sValue = PlayObject.m_sUserID;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$IPADDR")// 登录IP
            {
                sValue = PlayObject.m_sIPaddr;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$X")  // 人物X坐标
            {
                nValue = PlayObject.m_nCurrX;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$Y") // 人物Y坐标
            {
                nValue = PlayObject.m_nCurrY;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAP")
            {
                sValue = PlayObject.m_PEnvir.sMapName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GUILDNAME")
            {
                if (PlayObject.m_MyGuild != null)
                {
                    sValue = PlayObject.m_MyGuild.sGuildName;
                }
                else
                {
                    sValue = "无";
                }
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GUILDMEMBERCOUNT") // 行会成员上限
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.m_nGuildMemberCount;
                    nDataType = 1;
                    result = true;
                    return result;
                }
            }
            if (sVariable == "$GUILDFOUNTAIN") // 行会泉水仓库
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.m_nGuildFountain;
                    nDataType = 1;
                    result = true;
                    return result;
                }
            }
            if (sVariable == "$ALCOHOL") // 酒量
            {
                nValue = PlayObject.m_Abil.MaxAlcohol;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MEDICINEVALUE") // 药力值
            {
                nValue = PlayObject.m_Abil.MedicineValue;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$RANKNAME")
            {
                sValue = PlayObject.m_sGuildRankName;
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$LEVEL")
            {
                nValue = PlayObject.m_Abil.Level;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$USEGAMEGIRD") // 每次使用灵符数，$USEGAMEGIRD变量使用 
            {
                nValue = (int)PlayObject.m_UseGameGird;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$BUYSHOP")// 每次商铺花的元宝数量
            {
                nValue = PlayObject.m_BuyShopPrice;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GETCRYSTALEXP")// 天地结晶可提取的经验
            {
                nValue = (int)PlayObject.m_nGetCrystalExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GETCRYSTALNGEXP") // 天地结晶可提取的内功经验
            {
                nValue = (int)PlayObject.m_nGetCrystalNGExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$CRYSTALEXP") // 天地结晶当前的经验
            {
                nValue = (int)PlayObject.m_CrystalExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$CRYSTALNGEXP")  // 天地结晶当前的内功经验
            {
                nValue = (int)PlayObject.m_CrystalNGExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$CRYSTALLEVEL")  // 天地结晶等级
            {
                nValue = HUtil32._MIN(5, PlayObject.m_CrystalLevel);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GETEXP")  // 人物取得的经验
            {
                nValue = (int)PlayObject.m_GetExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$HEROGETEXP") // 英雄取得的经验
            {
                if (PlayObject.m_MyHero != null)
                {
                    nValue = (int)((THeroObject)(PlayObject.m_MyHero)).m_GetExp;
                }
                else
                {
                    nValue = 0;
                }
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GLORYPOINT") // 人物荣誉值
            {
                nValue = PlayObject.m_btGameGlory;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$HP")
            {
                nValue = PlayObject.m_WAbil.HP;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXHP")
            {
                nValue = PlayObject.m_WAbil.MaxHP;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MP")
            {
                nValue = PlayObject.m_WAbil.MP;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXMP")
            {
                nValue = PlayObject.m_WAbil.MaxMP;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$AC")
            {
                nValue = HUtil32.LoWord(PlayObject.m_WAbil.AC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXAC")
            {
                nValue = HUtil32.HiWord(PlayObject.m_WAbil.AC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAC")
            {
                nValue = HUtil32.LoWord(PlayObject.m_WAbil.MAC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXMAC")
            {
                nValue = HUtil32.HiWord(PlayObject.m_WAbil.MAC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$DC")
            {
                nValue = HUtil32.LoWord(PlayObject.m_WAbil.DC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXDC")
            {
                nValue = HUtil32.HiWord(PlayObject.m_WAbil.DC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MC")
            {
                nValue = HUtil32.LoWord(PlayObject.m_WAbil.MC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXMC")
            {
                nValue = HUtil32.HiWord(PlayObject.m_WAbil.MC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$SC")
            {
                nValue = HUtil32.LoWord(PlayObject.m_WAbil.SC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXSC")
            {
                nValue = HUtil32.HiWord(PlayObject.m_WAbil.SC);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$EXP")
            {
                nValue = (int)PlayObject.m_Abil.Exp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXEXP")
            {
                nValue = (int)PlayObject.m_Abil.MaxExp;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$PKPOINT")
            {
                nValue = PlayObject.m_nPkPoint;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$CREDITPOINT")
            {
                nValue = PlayObject.m_btCreditPoint;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$HW")
            {
                nValue = PlayObject.m_WAbil.HandWeight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXHW")
            {
                nValue = PlayObject.m_WAbil.MaxHandWeight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$BW")
            {
                nValue = PlayObject.m_WAbil.Weight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXBW")
            {
                nValue = PlayObject.m_WAbil.MaxWeight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$WW")
            {
                nValue = PlayObject.m_WAbil.WearWeight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$MAXWW")
            {
                nValue = PlayObject.m_WAbil.MaxWearWeight;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GOLDCOUNT")
            {
                nValue = PlayObject.m_nGold;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEGOLD")
            {
                nValue = PlayObject.m_nGameGold;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEDIAMOND")
            {
                nValue = PlayObject.m_nGAMEDIAMOND;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$GAMEGIRD")
            {
                nValue = PlayObject.m_nGAMEGIRD;
                nDataType = 1;
                result = true;
                return result;
            }
            if (HUtil32.CompareLStr(sVariable, "$HUMAN", 6))  // 人物变量
            {
                HUtil32.ArrestStringEx(sVariable, "(", ")", ref sVarValue2);
                if (PlayObject.m_DynamicVarList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_DynamicVarList.Count; I++)
                    {
                        DynamicVar = PlayObject.m_DynamicVarList[I];
                        if ((DynamicVar.sName).ToLower().CompareTo((sVarValue2).ToLower()) == 0)
                        {
                            switch (DynamicVar.VarType)
                            {
                                case TVarType.vInteger:
                                    nValue = DynamicVar.nInternet;
                                    nDataType = 1;
                                    result = true;
                                    return result;
                                case TVarType.vString://加对自定义字符型变量的支持
                                    sValue = DynamicVar.sString;
                                    nDataType = 0;
                                    result = true;
                                    return result;
                            }
                            break;
                        }
                    }
                }
            }
            if (sVariable == "$GAMEPOINT")
            {
                nValue = PlayObject.m_nGamePoint;
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$HUNGER")
            {
                nValue = PlayObject.GetMyStatus();
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$LOGINTIME")
            {
                sValue = (PlayObject.m_dLogonTime).ToString();
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$DATETIME")
            {
                //sValue = FormatDateTime("dddddd,dddd,hh:mm:nn", DateTime.Now);
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$LOGINLONG")
            {
                nValue = Convert.ToInt32((HUtil32.GetTickCount() - PlayObject.m_dwLogonTick) / 60000);
                nDataType = 1;
                result = true;
                return result;
            }
            if (sVariable == "$DRESS")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_DRESS]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$WEAPON")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_WEAPON]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$RIGHTHAND")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RIGHTHAND]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$HELMET")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_HELMET]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$ZHULI")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ZHULI]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$NECKLACE")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_NECKLACE]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$RING_R")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGR]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$RING_L")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_RINGL]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$ARMRING_R")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGR]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$ARMRING_L")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_ARMRINGL]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$BUJUK")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BUJUK]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$BELT")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BELT]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$BOOTS")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_BOOTS]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$CHARM")
            {
                sValue = UserEngine.GetStdItemName(PlayObject.m_UseItems[TPosition.U_CHARM]->wIndex);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$IPADDR")
            {
                sValue = PlayObject.m_sIPaddr;
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$IPLOCAL")
            {
                sValue = PlayObject.m_sIPLocal;
                // GetIPLocal(PlayObject.m_sIPaddr);
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$GUILDBUILDPOINT")
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.nBuildPoint;
                }
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$GUILDAURAEPOINT")
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.nAurae;
                }
                nDataType = 0;
                result = true;
                return result;
            }
            else if (sVariable == "$GUILDSTABILITYPOINT")
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.nStability;
                }
                nDataType = 0;
                result = true;
                return result;
            }
            if (sVariable == "$GUILDFLOURISHPOINT")
            {
                if (PlayObject.m_MyGuild != null)
                {
                    nValue = PlayObject.m_MyGuild.nFlourishing;
                }
                nDataType = 0;
                result = true;
                return result;
            }
            return result;
        }

        /// <summary>
        /// 设置文本变量值
        /// </summary>
        /// <param name="PlayObject">当前玩家</param>
        /// <param name="sVarName">名称名称</param>
        /// <param name="sValue">字符串</param>
        /// <param name="nValue">整形</param>
        /// <param name="nDataType">变量类型 0:全局变量信息 1:个人变量信息</param>
        /// <returns>是否成功</returns>
        public bool SetValNameValue(TPlayObject PlayObject, string sVarName, string sValue, int nValue, int nDataType)
        {
            bool result = false;
            int n100 = M2Share.GetValNameNo(sVarName);
            if (n100 >= 0)
            {
                switch (nDataType)
                {
                    case 1:
                        if (HUtil32.rangeInDefined(n100, 0, 99))
                        {
                            PlayObject.m_nVal[n100] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 100, 199))
                        {
                            M2Share.g_Config.GlobalVal[n100 - 100] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 200, 299))
                        {
                            PlayObject.m_DyVal[n100 - 200] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 300, 399))
                        {
                            PlayObject.m_nMval[n100 - 300] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 400, 499))
                        {
                            M2Share.g_Config.GlobaDyMval[n100 - 400] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 500, 599))
                        {
                            PlayObject.m_nInteger[n100 - 500] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 600, 699))
                        {
                            PlayObject.m_sString[n100 - 600] = (nValue).ToString();
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 700, 799))
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 700] = (nValue).ToString();
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 800, 1199))    // G变量
                        {
                            M2Share.g_Config.GlobalVal[n100 - 700] = nValue;
                            result = true;
                        }
                        else if (HUtil32.rangeInDefined(n100, 1200, 1599))    // A变量
                        {
                            M2Share.g_Config.GlobalAVal[n100 - 1100] = (nValue).ToString();
                            result = true;
                        }
                        else
                        {
                            result = false;
                        }
                        break;
                    case 0:

      

                        switch (n100)
                        {
                                
                            // Modify the A .. B: 0 .. 99
                            case 0:
                                // 20090102 增加
                                PlayObject.m_nVal[n100] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 100 .. 199
                            case 100:
                                M2Share.g_Config.GlobalVal[n100 - 100] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 200 .. 299
                            case 200:
                                PlayObject.m_DyVal[n100 - 200] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 300 .. 399
                            case 300:
                                PlayObject.m_nMval[n100 - 300] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 400 .. 499
                            case 400:
                                M2Share.g_Config.GlobaDyMval[n100 - 400] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 500 .. 599
                            case 500:
                                PlayObject.m_nInteger[n100 - 500] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 600 .. 699
                            case 600:
                                PlayObject.m_sString[n100 - 600] = sValue;
                                result = true;
                                break;
                            // Modify the A .. B: 700 .. 799
                            case 700:
                                M2Share.g_Config.GlobalAVal[n100 - 700] = sValue;
                                result = true;
                                break;
                            // Modify the A .. B: 800 .. 1199
                            case 800:
                                M2Share.g_Config.GlobalVal[n100 - 700] = HUtil32.Str_ToInt(sValue, 0);
                                result = true;
                                break;
                            // Modify the A .. B: 1200 .. 1599
                            case 1200:
                                // 20080903 A变量(100-499)
                                M2Share.g_Config.GlobalAVal[n100 - 1100] = sValue;
                                result = true;
                                break;
                            default:
                                result = false;
                                break;
                        }
                        break;
                    case 3:
                        switch (n100)
                        {
                            // Modify the A .. B: 0 .. 99
                            case 0:
                                // 20080323 原为0..99
                                PlayObject.m_nVal[n100] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 100 .. 199
                            case 100:
                                M2Share.g_Config.GlobalVal[n100 - 100] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 200 .. 299
                            case 200:
                                // 20080323 原为200..209
                                PlayObject.m_DyVal[n100 - 200] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 300 .. 399
                            case 300:
                                PlayObject.m_nMval[n100 - 300] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 400 .. 499
                            case 400:
                                M2Share.g_Config.GlobaDyMval[n100 - 400] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 500 .. 599
                            case 500:
                                PlayObject.m_nInteger[n100 - 500] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 600 .. 699
                            case 600:
                                PlayObject.m_sString[n100 - 600] = sValue;
                                result = true;
                                break;
                            // Modify the A .. B: 700 .. 799
                            case 700:
                                M2Share.g_Config.GlobalAVal[n100 - 700] = sValue;
                                result = true;
                                break;
                            // Modify the A .. B: 800 .. 1199
                            case 800:
                                // 20080903 G变量
                                M2Share.g_Config.GlobalVal[n100 - 700] = nValue;
                                result = true;
                                break;
                            // Modify the A .. B: 1200 .. 1599
                            case 1200:
                                // 20080903 A变量(100-499)
                                M2Share.g_Config.GlobalAVal[n100 - 1100] = sValue;
                                result = true;
                                break;
                            default:
                                result = false;
                                break;
                        }
                        break;
                }
            }
            else
            {
                result = false;
            }
            return result;
        }

        public bool GotoLable_MovData_GetValNameValue(TPlayObject PlayObject, string sVarName, ref string sValue, ref int nValue, ref int nDataType)
        {
            bool result = false;
            nValue = -1;
            sValue = "";
            nDataType = -1;
            int n100 = M2Share.GetValNameNo(sVarName);
            if (n100 >= 0)
            {
                if (HUtil32.rangeInDefined(n100, 0, 99))
                {
                    nValue = PlayObject.m_nVal[n100];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 100, 199))
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 100];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 200, 299))
                {
                    nValue = PlayObject.m_DyVal[n100 - 200];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 300, 399))
                {
                    nValue = PlayObject.m_nMval[n100 - 300];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 400, 499))
                {
                    nValue = M2Share.g_Config.GlobaDyMval[n100 - 400];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 500, 599))
                {
                    nValue = PlayObject.m_nInteger[n100 - 500];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 600, 699))
                {
                    sValue = PlayObject.m_sString[n100 - 600];
                    nDataType = 0;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 700, 799))
                {
                    sValue = M2Share.g_Config.GlobalAVal[n100 - 700];
                    nDataType = 0;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 800, 1199))  // G变量
                {
                    nValue = M2Share.g_Config.GlobalVal[n100 - 700];
                    nDataType = 1;
                    result = true;
                }
                else if (HUtil32.rangeInDefined(n100, 1200, 1599))  // A变量
                {
                    sValue = M2Share.g_Config.GlobalAVal[n100 - 1100];
                    nDataType = 0;
                    result = true;
                }
                else {
                    result = false;
                }
            }
            else
            {
                result = false;
            }
            return result;
        }

        public bool GotoLable_MovData_GetDynamicVarValue(TPlayObject PlayObject, string sVarType, string sVarName, ref string sValue, ref int nValue, ref int nDataType)
        {
            bool result = false;
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            bool boVarFound;
            boVarFound = false;
            sValue = "";
            nValue = -1;
            nDataType = -1;
            DynamicVarList = GetDynamicVarList(PlayObject, sVarType, ref sName);
            if (DynamicVarList == null)
            {
                result = false;
                return result;
            }
            if (DynamicVarList.Count > 0)
            {
                for (int V = 0; V < DynamicVarList.Count; V++)
                {
                    DynamicVar = DynamicVarList[V];
                    if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                    {
                        switch (DynamicVar.VarType)
                        {
                            case TVarType.vInteger:
                                nValue = DynamicVar.nInternet;
                                nDataType = 1;
                                break;
                            case TVarType.vString:
                                sValue = DynamicVar.sString;
                                nDataType = 0;
                                break;
                        }
                        boVarFound = true;
                        break;
                    }
                }
            }
            if (!boVarFound)
            {
                result = false;
            }
            else
            {
                result = true;
            }
            return result;
        }

        public bool GotoLable_MovData_SetDynamicVarValue(TPlayObject PlayObject, string sVarType, string sVarName, string sValue, int nValue, int nDataType)
        {
            bool result = false;
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            bool boVarFound;
            boVarFound = false;
            DynamicVarList = GetDynamicVarList(PlayObject, sVarType, ref sName);
            if (DynamicVarList == null)
            {
                result = false;
                return result;
            }
            if (DynamicVarList.Count > 0)
            {
                for (int V = 0; V < DynamicVarList.Count; V++)
                {
                    DynamicVar = DynamicVarList[V];
                    if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                    {
                        if (nDataType == 1)
                        {
                            switch (DynamicVar.VarType)
                            {
                                case TVarType.vInteger:
                                    DynamicVar.nInternet = nValue;
                                    boVarFound = true;
                                    break;
                            }
                        }
                        else
                        {
                            switch (DynamicVar.VarType)
                            {
                                case TVarType.vString:
                                    DynamicVar.sString = sValue;
                                    boVarFound = true;
                                    break;
                            }
                        }
                    }
                }
            }
            if (!boVarFound)
            {
                result = false;
            }
            else
            {
                result = true;
            }
            return result;
        }

        public int GotoLable_MovData_GetDataType(TQuestActionInfo QuestActionInfo)
        {
            int result = -1;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            int n01;
            if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = QuestActionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = QuestActionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = QuestActionInfo.sParam3;
            }
            if (HUtil32.IsVarNumber(sParam1))
            {
                if ((sParam3 != "") && (sParam3[0] == '<') && (sParam3[sParam3.Length] == '>'))
                {
                    result = 0;
                }
                else if ((sParam3 != "") && (M2Share.GetValNameNo(sParam3) >= 0))
                {
                    result = 1;
                }
                else if ((sParam3 != "") && HUtil32.IsStringNumber(sParam3))
                {
                    result = 2;
                }
                else
                {
                    result = 3;
                }
                return result;
            }
            n01 = M2Share.GetValNameNo(sParam1);
            if (n01 >= 0)
            {
                if ((sParam2 != "") && (sParam2[0] == '<') && (sParam2[sParam2.Length - 1] == '>'))
                {
                    result = 4;
                }
                else if ((sParam2 != "") && (M2Share.GetValNameNo(sParam2) >= 0))
                {
                    result = 5;
                }
                else if ((sParam2 != "") && HUtil32.IsVarNumber(sParam2))
                {
                    result = 6;
                }
                else
                {
                    result = 7;
                }
                return result;
            }
            return result;
        }

        public void GotoLable_MovData(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            string sValue = string.Empty;
            int nValue = 0;
            int nDataType = 0;
            const string sVarFound = "变量%s不存在，变量类型:{0}";
            const string sVarTypeError = "变量类型错误，错误类型:{0} 当前支持类型(HUMAN、GUILD、GLOBAL)";
            const string sDataTypeError = "变量类型不一致，错误类型:{0} {1}";
            if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = QuestActionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = QuestActionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = QuestActionInfo.sParam3;
            }
            if (sParam1 == "")
            {
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                return;
            }
            switch (GotoLable_MovData_GetDataType(QuestActionInfo))
            {
                case 0:
                    if (GetHumanInfoValue(PlayObject, sParam3, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!GotoLable_MovData_SetDynamicVarValue(PlayObject, sParam1, sParam2, sValue, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam1, sParam2 }), QuestActionInfo, M2Share.sMOV);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    }
                    return;
                case 1:
                    if (GotoLable_MovData_GetValNameValue(PlayObject, sParam3, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!GotoLable_MovData_SetDynamicVarValue(PlayObject, sParam1, sParam2, sValue, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam1, sParam2 }), QuestActionInfo, M2Share.sMOV);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    }
                    return;
                case 2:
                    if (!GotoLable_MovData_SetDynamicVarValue(PlayObject, sParam1, sParam2, QuestActionInfo.sParam3, QuestActionInfo.nParam3, 1))
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam1, sParam2 }), QuestActionInfo, M2Share.sMOV);
                    }
                    break;
                case 3:
                    if (!GotoLable_MovData_SetDynamicVarValue(PlayObject, sParam1, sParam2, QuestActionInfo.sParam3, QuestActionInfo.nParam3, 0))
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, sParam1, sParam2), QuestActionInfo, M2Share.sMOV);
                    }
                    break;
                case 4:
                    if (GetHumanInfoValue(PlayObject, sParam2, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!SetValNameValue(PlayObject, sParam1, sValue, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    }
                    return;
                case 5:
                    if (GotoLable_MovData_GetValNameValue(PlayObject, sParam2, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!SetValNameValue(PlayObject, sParam1, sValue, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    }
                    return;
                case 6:
                    if (GotoLable_MovData_GetDynamicVarValue(PlayObject, sParam2, sParam3, ref sValue, ref nValue, ref nDataType))
                    {
                        if (!SetValNameValue(PlayObject, sParam1, sValue, nValue, nDataType))
                        {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, sParam2, sParam3), QuestActionInfo, M2Share.sMOV);
                    }
                    return;
                case 7:
                    if (GotoLable_MovData_GetValNameValue(PlayObject, sParam1, ref sValue, ref nValue, ref nDataType))
                    {
                        if ((sParam2 != "") && (sParam2[0] == '<') && (sParam2[1] == '$'))  // 支持:MOV A14 <$USERALLNAME>\天下第一战士 的传值
                        {
                            GetHumanInfoValue(PlayObject, sParam2, ref sValue, ref nValue, ref nDataType);// 取人物信息
                            sValue = sValue + sParam2.Substring(sParam2.IndexOf("\\") - 1, sParam2.Length - sParam2.IndexOf("\\") + 1);
                            if (!SetValNameValue(PlayObject, sParam1, sValue, nValue, nDataType))
                            {
                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                                return;
                            }
                        }
                        else
                        {
                            if (!SetValNameValue(PlayObject, sParam1, QuestActionInfo.sParam2, QuestActionInfo.nParam2, nDataType))
                            {
                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                                return;
                            }
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    }
                    break;
                default:
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOV);
                    break;
            }
        }

        public void GotoLable_IncInteger(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int I;
            int n14 = 0;
            int n3C = 0;
            int n10 = 0;
            string s01 = string.Empty;
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            bool boVarFound;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            const string sVarFound = "变量{0}不存在，变量类型:{1}";
            const string sVarTypeError = "变量类型错误，错误类型:{0} 当前支持类型(HUMAN、GUILD、GLOBAL)";
            n10 = 0;
            if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = QuestActionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = QuestActionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = QuestActionInfo.sParam3;
            }
            if ((sParam1 == "") || (sParam2 == ""))
            {
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                return;
            }
            if (sParam3 != "")
            {
                if ((!HUtil32.IsVarNumber(sParam1)) && (HUtil32.IsVarNumber(sParam2)))
                {
                    n10 = 1;
                    boVarFound = false;
                    DynamicVarList = GetDynamicVarList(PlayObject, sParam2, ref sName);
                    if (DynamicVarList == null)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sParam2 }), QuestActionInfo, M2Share.sINC);
                        return;
                    }
                    if (DynamicVarList.Count > 0)
                    {
                        for (I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((sParam3).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        n3C = DynamicVar.nInternet;
                                        break;
                                    case TVarType.vString:
                                        s01 = DynamicVar.sString;
                                        break;
                                }
                                boVarFound = true;
                                break;
                            }
                        }
                    }
                    if (!boVarFound)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, sParam3, sParam2), QuestActionInfo, M2Share.sINC);
                        return;
                    }
                    n14 = M2Share.GetValNameNo(sParam1);
                    if (n14 >= 0)
                    {
                        if (HUtil32.rangeInDefined(n14, 0, 99))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nVal[n14] += n3C;
                            }
                            else
                            {
                                PlayObject.m_nVal[n14]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 100, 199))
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobalVal[n14 - 100] += n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobalVal[n14 - 100]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 200, 299))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_DyVal[n14 - 200] += n3C;
                            }
                            else
                            {
                                PlayObject.m_DyVal[n14 - 200]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 300, 399))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nMval[n14 - 300] += n3C;
                            }
                            else
                            {
                                PlayObject.m_nMval[n14 - 300]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 400, 499))
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobaDyMval[n14 - 400] += n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobaDyMval[n14 - 400]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 500, 599))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nInteger[n14 - 500] += n3C;
                            }
                            else
                            {
                                PlayObject.m_nInteger[n14 - 500]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 600, 699))
                        {
                            PlayObject.m_sString[n14 - 600] = PlayObject.m_sString[n14 - 600] + s01;
                        }
                        else if (HUtil32.rangeInDefined(n14, 700, 799))
                            {
                                M2Share.g_Config.GlobalAVal[n14 - 700] = M2Share.g_Config.GlobalAVal[n14 - 700] + s01;
                            }
                        else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                            {
                                if (n3C > 1)
                                {
                                    M2Share.g_Config.GlobalVal[n14 - 700] += n3C;
                                }
                                else
                                {
                                    M2Share.g_Config.GlobalVal[n14 - 700]++;
                                }
                            }
                         else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                            {
                                M2Share.g_Config.GlobalAVal[n14 - 1100] = M2Share.g_Config.GlobalAVal[n14 - 1100] + s01;
                            }
                            else
                            {
                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                            }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                        return;
                    }
                    return;
                }
                if ((HUtil32.IsVarNumber(sParam1)) && (!HUtil32.IsVarNumber(sParam2)))
                {
                    if ((sParam3 != "") && (!HUtil32.IsStringNumber(sParam3)))
                    {
                        n10 = 1;
                        n14 = M2Share.GetValNameNo(sParam3);
                        if (n14 >= 0)
                        {
                            if (HUtil32.rangeInDefined(n14, 0, 99))
                            {
                                n3C = PlayObject.m_nVal[n14];
                            }
                            else if (HUtil32.rangeInDefined(n14, 100, 199))
                            {
                                n3C = M2Share.g_Config.GlobalVal[n14 - 100];
                            }
                            else if (HUtil32.rangeInDefined(n14, 200, 299))
                            {
                                n3C = PlayObject.m_DyVal[n14 - 200];
                            }
                            else if (HUtil32.rangeInDefined(n14, 300, 399))
                            {
                                n3C = PlayObject.m_nMval[n14 - 300];
                            }
                            else if (HUtil32.rangeInDefined(n14, 400, 499))
                            {
                                n3C = M2Share.g_Config.GlobaDyMval[n14 - 400];
                            }
                            else if (HUtil32.rangeInDefined(n14, 500, 599))
                            {
                                n3C = PlayObject.m_nInteger[n14 - 500];
                            }
                            else if (HUtil32.rangeInDefined(n14, 600, 699))
                            {
                                s01 = PlayObject.m_sString[n14 - 600];
                            }
                            else if (HUtil32.rangeInDefined(n14, 700, 799))
                            {
                                s01 = M2Share.g_Config.GlobalAVal[n14 - 700];
                            }
                            else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                            {
                                n3C = M2Share.g_Config.GlobalVal[n14 - 700];
                            }
                            else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                            {
                                s01 = M2Share.g_Config.GlobalAVal[n14 - 1100];
                            }
                            else 
                            {
                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                            }
                        }
                        else
                        {
                            s01 = sParam3;
                        }
                    }
                    else
                    {
                        n3C = QuestActionInfo.nParam3;
                    }
                    boVarFound = false;
                    DynamicVarList = GetDynamicVarList(PlayObject, sParam1, ref sName);
                    if (DynamicVarList == null)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarTypeError, sParam1), QuestActionInfo, M2Share.sINC);
                        return;
                    }
                    if (DynamicVarList.Count > 0)
                    {
                        for (I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((sParam2).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        if (n3C > 1)
                                        {
                                            DynamicVar.nInternet += n3C;
                                        }
                                        else
                                        {
                                            DynamicVar.nInternet++;
                                        }
                                        break;
                                    case TVarType.vString:
                                        DynamicVar.sString = DynamicVar.sString + s01;
                                        break;
                                }
                                boVarFound = true;
                                break;
                            }
                        }
                    }
                    if (!boVarFound)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam2, sParam1 }), QuestActionInfo, M2Share.sINC);
                        return;
                    }
                    return;
                }
                if (n10 == 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                }
            }
            else
            {
                if ((sParam2 != "") && (!HUtil32.IsStringNumber(sParam2))) // 获取第2个变量值
                {
                    n14 = M2Share.GetValNameNo(sParam2);
                    if (n14 >= 0)
                    {
                        if (HUtil32.rangeInDefined(n14, 0, 99))
                        {
                            n3C = PlayObject.m_nVal[n14];
                        }
                        else if (HUtil32.rangeInDefined(n14, 100, 199))
                        {
                            n3C = M2Share.g_Config.GlobalVal[n14 - 100];
                        }
                        else if (HUtil32.rangeInDefined(n14, 200, 299))
                        {
                            n3C = PlayObject.m_DyVal[n14 - 200];
                        }
                        else if (HUtil32.rangeInDefined(n14, 300, 399))
                        {
                            n3C = PlayObject.m_nMval[n14 - 300];
                        }
                        else if (HUtil32.rangeInDefined(n14, 400, 499))
                        {
                            n3C = M2Share.g_Config.GlobaDyMval[n14 - 400];
                        }
                        else if (HUtil32.rangeInDefined(n14, 500, 599))
                        {
                            n3C = PlayObject.m_nInteger[n14 - 500];
                        }
                        else if (HUtil32.rangeInDefined(n14, 600, 699))
                        {
                            s01 = PlayObject.m_sString[n14 - 600];
                        }
                        else if (HUtil32.rangeInDefined(n14, 700, 799))
                        {
                            s01 = M2Share.g_Config.GlobalAVal[n14 - 700];
                        }
                        else if (HUtil32.rangeInDefined(n14, 800, 1199))//  G变量
                        {
                            n3C = M2Share.g_Config.GlobalVal[n14 - 700];
                        }
                        else if (HUtil32.rangeInDefined(n14, 1200, 1599))//  A变量(100-499)
                        {
                            s01 = M2Share.g_Config.GlobalAVal[n14 - 1100];
                        }
                        else {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                        }
                    }
                    else
                    {
                        n3C = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, sParam2), 0);//个人变量支持
                        s01 = sParam2;
                    }
                }
                else
                {
                    n3C = QuestActionInfo.nParam2;
                }
                n14 = M2Share.GetValNameNo(sParam1);
                if (n14 >= 0)
                {
                    if (HUtil32.rangeInDefined(n14, 0, 99))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nVal[n14] += n3C;
                        }
                        else
                        {
                            PlayObject.m_nVal[n14]++;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 100, 199))
                    {
                        if (n3C > 1)
                        {
                            M2Share.g_Config.GlobalVal[n14 - 100] += n3C;
                        }
                        else
                        {
                            M2Share.g_Config.GlobalVal[n14 - 100]++;
                        }

                    }
                    else if (HUtil32.rangeInDefined(n14, 200, 299))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_DyVal[n14 - 200] += n3C;
                        }
                        else
                        {
                            PlayObject.m_DyVal[n14 - 200]++;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 300, 399))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nMval[n14 - 300] += n3C;
                        }
                        else
                        {
                            PlayObject.m_nMval[n14 - 300]++;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 400, 499))
                    {
                        if (n3C > 1)
                        {
                            M2Share.g_Config.GlobaDyMval[n14 - 400] += n3C;
                        }
                        else
                        {
                            M2Share.g_Config.GlobaDyMval[n14 - 400]++;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 500, 599))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nInteger[n14 - 500] += n3C;
                        }
                        else
                        {
                            PlayObject.m_nInteger[n14 - 500]++;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 600, 699))
                    {
                        PlayObject.m_sString[n14 - 600] = PlayObject.m_sString[n14 - 600] + s01;
                    }
                    else
                        if (HUtil32.rangeInDefined(n14, 700, 799))
                        {
                            M2Share.g_Config.GlobalAVal[n14 - 700] = M2Share.g_Config.GlobalAVal[n14 - 700] + s01;
                        }
                        else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobalVal[n14 - 700] += n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobalVal[n14 - 700]++;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                        {
                            M2Share.g_Config.GlobalAVal[n14 - 1100] = M2Share.g_Config.GlobalAVal[n14 - 1100] + s01;
                        }
                        else
                        {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                        }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sINC);
                    return;
                }
            }
        }

        public void GotoLable_DecInteger(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int n14 = 0;
            int n3C = 0;
            int n10 = 0;
            TDynamicVar DynamicVar;
            IList<TDynamicVar> DynamicVarList;
            string sName = string.Empty;
            string s01 = string.Empty;
            string s02 = string.Empty;
            string s03 = string.Empty;
            bool boVarFound;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            const string sVarFound = "变量{0}不存在，变量类型:{1}";
            const string sVarTypeError = "变量类型错误，错误类型:{0} 当前支持类型(HUMAN、GUILD、GLOBAL)";
            if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref sParam1);
            }
            else
            {
                sParam1 = QuestActionInfo.sParam1;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref sParam2);
            }
            else
            {
                sParam2 = QuestActionInfo.sParam2;
            }
            if (HUtil32.CompareLStr(QuestActionInfo.sParam3, "<$STR(", 6))
            {
                HUtil32.ArrestStringEx(QuestActionInfo.sParam3, "(", ")", ref sParam3);
            }
            else
            {
                sParam3 = QuestActionInfo.sParam3;
            }
            if ((sParam1 == "") || (sParam2 == ""))
            {
                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                return;
            }
            if (sParam3 != "")
            {
                if ((!HUtil32.IsVarNumber(sParam1)) && (HUtil32.IsVarNumber(sParam2)))
                {
                    n10 = 1;
                    boVarFound = false;
                    DynamicVarList = GetDynamicVarList(PlayObject, sParam2, ref sName);
                    if (DynamicVarList == null)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarTypeError, sParam2), QuestActionInfo, M2Share.sDEC);
                        return;
                    }
                    if (DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((sParam3).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        n3C = DynamicVar.nInternet;
                                        break;
                                    case TVarType.vString:
                                        s01 = DynamicVar.sString;
                                        break;
                                }
                                boVarFound = true;
                                break;
                            }
                        }
                    }
                    if (!boVarFound)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam3, sParam2 }), QuestActionInfo, M2Share.sDEC);
                        return;
                    }
                    n14 = M2Share.GetValNameNo(sParam1);
                    if (n14 >= 0)
                    {
                        if (HUtil32.rangeInDefined(n14, 0, 99))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nVal[n14] -= n3C;
                            }
                            else
                            {
                                PlayObject.m_nVal[n14] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 100, 199))
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobalVal[n14 - 100] -= n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobalVal[n14 - 100] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 200, 299))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_DyVal[n14 - 200] -= n3C;
                            }
                            else
                            {
                                PlayObject.m_DyVal[n14 - 200] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 300, 399))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nMval[n14 - 300] -= n3C;
                            }
                            else
                            {
                                PlayObject.m_nMval[n14 - 300] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 400, 499))
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobaDyMval[n14 - 400] -= n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobaDyMval[n14 - 400] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 500, 599))
                        {
                            if (n3C > 1)
                            {
                                PlayObject.m_nInteger[n14 - 500] -= n3C;
                            }
                            else
                            {
                                PlayObject.m_nInteger[n14 - 500] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 600, 699))
                        {
                            n10 = PlayObject.m_sString[n14 - 600].IndexOf(s01);
                            //s02 = Copy(PlayObject.m_sString[n14 - 600], 1, n10 - 1);
                            //s03 = Copy(PlayObject.m_sString[n14 - 600], s01.Length + n10, PlayObject.m_sString[n14 - 600].Length);
                            PlayObject.m_sString[n14 - 600] = s02 + s03;
                        }
                        else if (HUtil32.rangeInDefined(n14, 700, 799))
                        {
                            n10 = M2Share.g_Config.GlobalAVal[n14 - 700].IndexOf(s01);
                            //s02 = Copy(M2Share.g_Config.GlobalAVal[n14 - 700], 1, n10 - 1);
                            //s03 = Copy(M2Share.g_Config.GlobalAVal[n14 - 700], s01.Length + n10, M2Share.g_Config.GlobalAVal[n14 - 700].Length);
                            M2Share.g_Config.GlobalAVal[n14 - 700] = s02 + s03;
                        }
                        else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                        {
                            if (n3C > 1)
                            {
                                M2Share.g_Config.GlobalVal[n14 - 700] -= n3C;
                            }
                            else
                            {
                                M2Share.g_Config.GlobalVal[n14 - 700] -= 1;
                            }
                        }
                        else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                        {
                            n10 = M2Share.g_Config.GlobalAVal[n14 - 1100].IndexOf(s01);
                            //s02 = Copy(M2Share.g_Config.GlobalAVal[n14 - 1100], 1, n10 - 1);
                            //s03 = Copy(M2Share.g_Config.GlobalAVal[n14 - 1100], s01.Length + n10, M2Share.g_Config.GlobalAVal[n14 - 1100].Length);
                            M2Share.g_Config.GlobalAVal[n14 - 1100] = s02 + s03;
                        }
                        else {
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                        }
                    }
                    else
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                        return;
                    }
                    return;
                }
                if ((HUtil32.IsVarNumber(sParam1)) && (!HUtil32.IsVarNumber(sParam2)))
                {
                    if ((sParam3 != "") && (!HUtil32.IsStringNumber(sParam3)))
                    {
                        n10 = 1;
                        n14 = M2Share.GetValNameNo(sParam3);
                        if (n14 >= 0)
                        {
                            if (HUtil32.rangeInDefined(n14, 0, 99))
                            {
                                n3C = PlayObject.m_nVal[n14];
                            }
                            else if (HUtil32.rangeInDefined(n14, 100, 199))
                            {
                                n3C = M2Share.g_Config.GlobalVal[n14 - 100];
                            }
                            else if (HUtil32.rangeInDefined(n14, 200, 299))
                            {
                                n3C = PlayObject.m_DyVal[n14 - 200];
                            }
                            else if (HUtil32.rangeInDefined(n14, 300, 399))
                            {
                                n3C = PlayObject.m_nMval[n14 - 300];
                            }
                            else if (HUtil32.rangeInDefined(n14, 400, 499))
                            {
                                n3C = M2Share.g_Config.GlobaDyMval[n14 - 400];
                            }
                            else if (HUtil32.rangeInDefined(n14, 500, 599))
                            {
                                n3C = PlayObject.m_nInteger[n14 - 500];
                            }
                            else if (HUtil32.rangeInDefined(n14, 600, 699))
                            {
                                s01 = PlayObject.m_sString[n14 - 600];
                            }
                            else if (HUtil32.rangeInDefined(n14, 700, 799))
                            {
                                s01 = M2Share.g_Config.GlobalAVal[n14 - 700];
                            }
                            else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                            {
                                n3C = M2Share.g_Config.GlobalVal[n14 - 700];
                            }
                            else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                            {
                                s01 = M2Share.g_Config.GlobalAVal[n14 - 1100];
                            }
                            else {
                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                            }
                        }
                        else
                        {
                            s01 = sParam3;
                        }
                    }
                    else
                    {
                        n3C = QuestActionInfo.nParam3;
                    }
                    boVarFound = false;
                    DynamicVarList = GetDynamicVarList(PlayObject, sParam1, ref sName);
                    if (DynamicVarList == null)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sParam1 }), QuestActionInfo, M2Share.sDEC);
                        return;
                    }
                    if (DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if ((DynamicVar.sName).ToLower().CompareTo((sParam2).ToLower()) == 0)
                            {
                                switch (DynamicVar.VarType)
                                {
                                    case TVarType.vInteger:
                                        if (n3C > 1)
                                        {
                                            DynamicVar.nInternet -= n3C;
                                        }
                                        else
                                        {
                                            DynamicVar.nInternet -= 1;
                                        }
                                        break;
                                    case TVarType.vString:
                                        n10 = DynamicVar.sString.IndexOf(s01);
                                        s02 = DynamicVar.sString.Substring(1 - 1, n10 - 1);
                                        s03 = DynamicVar.sString.Substring(s01.Length + n10 - 1, DynamicVar.sString.Length);
                                        DynamicVar.sString = s02 + s03;
                                        break;
                                }
                                boVarFound = true;
                                break;
                            }
                        }
                    }
                    if (!boVarFound)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sParam2, sParam1 }), QuestActionInfo, M2Share.sDEC);
                        return;
                    }
                    return;
                }
                if (n10 == 0)
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                }
            }
            else
            {
                if ((sParam2 != "") && (!HUtil32.IsStringNumber(sParam2)))// 获取第2个变量值
                {
                    n14 = M2Share.GetValNameNo(sParam2);
                    if (n14 >= 0)
                    {
                        if (HUtil32.rangeInDefined(n14, 0, 99))
                        {
                            n3C = PlayObject.m_nVal[n14];
                        }
                        else if (HUtil32.rangeInDefined(n14, 100, 199)) {
                            n3C = M2Share.g_Config.GlobalVal[n14 - 100];
                        }
                        else if (HUtil32.rangeInDefined(n14, 200, 299))
                        {
                            n3C = PlayObject.m_DyVal[n14 - 200];
                        }
                        else if (HUtil32.rangeInDefined(n14, 300, 399))
                        {
                            n3C = PlayObject.m_nMval[n14 - 300];
                        }
                        else if (HUtil32.rangeInDefined(n14, 400, 499))
                        {
                            n3C = M2Share.g_Config.GlobaDyMval[n14 - 400];
                        }
                        else if (HUtil32.rangeInDefined(n14, 500, 599))
                        {
                            n3C = PlayObject.m_nInteger[n14 - 500];
                        }
                        else if (HUtil32.rangeInDefined(n14, 600,699))
                        {
                            s01 = PlayObject.m_sString[n14 - 600];
                        }
                        else if (HUtil32.rangeInDefined(n14, 700, 799))
                        {
                            s01 = M2Share.g_Config.GlobalAVal[n14 - 700];
                        }
                        else if (HUtil32.rangeInDefined(n14, 800, 1199)) //G变量
                        {
                            n3C = M2Share.g_Config.GlobalVal[n14 - 700];
                        }
                        else if (HUtil32.rangeInDefined(n14, 1200, 1599))//A变量
                        {
                            s01 = M2Share.g_Config.GlobalAVal[n14 - 1100];
                        }
                        else{
                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                        }
                    }
                    else
                    {
                        n3C = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, sParam2), 0);//对个人变量的支持
                        s01 = sParam2;
                    }
                }
                else
                {
                    n3C = QuestActionInfo.nParam2;
                }
                n14 = M2Share.GetValNameNo(sParam1);
                if (n14 >= 0)
                {
                    if (HUtil32.rangeInDefined(n14, 0, 99))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nVal[n14] -= n3C;
                        }
                        else
                        {
                            PlayObject.m_nVal[n14] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 100, 199))
                    {
                        if (n3C > 1)
                        {
                            M2Share.g_Config.GlobalVal[n14 - 100] -= n3C;
                        }
                        else
                        {
                            M2Share.g_Config.GlobalVal[n14 - 100] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 200, 299))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_DyVal[n14 - 200] -= n3C;
                        }
                        else
                        {
                            PlayObject.m_DyVal[n14 - 200] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 300, 399))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nMval[n14 - 300] -= n3C;
                        }
                        else
                        {
                            PlayObject.m_nMval[n14 - 300] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 400, 499))
                    {
                        if (n3C > 1)
                        {
                            M2Share.g_Config.GlobaDyMval[n14 - 400] -= n3C;
                        }
                        else
                        {
                            M2Share.g_Config.GlobaDyMval[n14 - 400] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 500, 599))
                    {
                        if (n3C > 1)
                        {
                            PlayObject.m_nInteger[n14 - 500] -= n3C;
                        }
                        else
                        {
                            PlayObject.m_nInteger[n14 - 500] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 600, 699))
                    {
                        n10 = PlayObject.m_sString[n14 - 600].IndexOf(s01);
                        //s02 = Copy(PlayObject.m_sString[n14 - 600], 1, n10 - 1);
                        //s03 = Copy(PlayObject.m_sString[n14 - 600], s01.Length + n10, PlayObject.m_sString[n14 - 600].Length);
                        PlayObject.m_sString[n14 - 600] = s02 + s03;
                    }
                    else if (HUtil32.rangeInDefined(n14, 700, 799))
                    {
                        n10 = M2Share.g_Config.GlobalAVal[n14 - 700].IndexOf(s01);
                        //s02 = Copy(M2Share.g_Config.GlobalAVal[n14 - 700], 1, n10 - 1);
                        // s03 = Copy(M2Share.g_Config.GlobalAVal[n14 - 700], s01.Length + n10, M2Share.g_Config.GlobalAVal[n14 - 700].Length);
                        M2Share.g_Config.GlobalAVal[n14 - 700] = s02 + s03;
                    }
                    else if (HUtil32.rangeInDefined(n14, 800, 1199))// G变量
                    {
                        if (n3C > 1)
                        {
                            M2Share.g_Config.GlobalVal[n14 - 700] -= n3C;
                        }
                        else
                        {
                            M2Share.g_Config.GlobalVal[n14 - 700] -= 1;
                        }
                    }
                    else if (HUtil32.rangeInDefined(n14, 1200, 1599))// A变量
                    {
                        n10 = M2Share.g_Config.GlobalAVal[n14 - 1100].IndexOf(s01);
                        //s02 = Copy(M2Share.g_Config.GlobalAVal[n14 - 1100], 1, n10 - 1);
                        //s03 = Copy(M2Share.g_Config.GlobalAVal[n14 - 1100], s01.Length + n10, M2Share.g_Config.GlobalAVal[n14 - 1100].Length);
                        M2Share.g_Config.GlobalAVal[n14 - 1100] = s02 + s03;
                    }
                    else {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sDEC);
                    return;
                }
            }
        }

        /// <summary>
        /// 设置变量对应的值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="nVarName"></param>
        /// <param name="nInteger"></param>
        /// <param name="sString"></param>
        /// <returns></returns>
        internal bool SetVarValues(TPlayObject PlayObject, int nValues, int nInteger, string sString)
        {
            bool result = false;
            if (HUtil32.rangeInDefined(nValues, 0, 99))
            {
                PlayObject.m_nVal[nValues] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 100, 199))
            {
                M2Share.g_Config.GlobalVal[nValues - 100] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 200, 299))
            {
                PlayObject.m_DyVal[nValues - 200] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 300, 399))
            {
                PlayObject.m_nMval[nValues - 300] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 400, 499))
            {
                M2Share.g_Config.GlobaDyMval[nValues - 400] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 500, 599))
            {
                PlayObject.m_nInteger[nValues - 500] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 600, 699))
            {
                PlayObject.m_sString[nValues - 600] = sString;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 700, 799))
            {
                M2Share.g_Config.GlobalAVal[nValues - 700] = sString;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 800, 1199)) //G变量
            {
                M2Share.g_Config.GlobalVal[nValues - 700] = nInteger;
                result = true;
            }
            else if (HUtil32.rangeInDefined(nValues, 1200, 1599))//A变量
            {
                M2Share.g_Config.GlobalAVal[nValues - 1100] = sString;
                result = true;
            }
            return result;
        }

        /// <summary>
        /// 根据变量名称取对应值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="nVarName"></param>
        /// <param name="n18"></param>
        /// <param name="s44"></param>
        internal bool GetVarValues(TPlayObject PlayObject, int nVarName, ref int nInteger, ref string sString)
        {
            bool result = false;
            if (HUtil32.rangeInDefined(nVarName, 0, 99))
            {
                nInteger = PlayObject.m_nVal[nVarName];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 100, 199))
            {
                nInteger = M2Share.g_Config.GlobalVal[nVarName - 100];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 200, 299))
            {
                nInteger = PlayObject.m_DyVal[nVarName - 200];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 300, 399))
            {
                nInteger = PlayObject.m_nMval[nVarName - 300];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 400, 499))
            {
                nInteger = M2Share.g_Config.GlobaDyMval[nVarName - 400];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 500, 599))
            {
                nInteger = PlayObject.m_nInteger[nVarName - 500];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 600, 699))
            {
                sString = PlayObject.m_sString[nVarName - 600];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 700, 799))
            {
                sString = M2Share.g_Config.GlobalAVal[nVarName - 700];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 800, 1199))//G变量
            {
                nInteger = M2Share.g_Config.GlobalVal[nVarName - 700];
                result = true;
            }
            else if (HUtil32.rangeInDefined(nVarName, 1200, 1599))//A变量(100-499)
            {
                sString = M2Share.g_Config.GlobalAVal[nVarName - 1100];
                result = true;
            }
            return result;
        }

        /// <summary>
        /// 执行脚本处理
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="UserItem"></param>
        /// <param name="ActionList"></param>
        /// <returns></returns>
        public unsafe bool QuestActionProcess(TPlayObject PlayObject, TUserItem* UserItem, IList<TQuestActionInfo> ActionList)
        {
            bool result = true;
            bool bo11 = false;
            int I, II, III;
            TQuestActionInfo QuestActionInfo;
            int n14 = 0, n18 = 0, n1C = 0, n28 = 0, n2C = 0, n20X = 0, n24Y = 0,
                n34 = 0, n38 = 0, n3C = 0, n40 = 0, n20 = 0, m_DelayGoto = 0;
            string s4C = string.Empty, s50 = string.Empty, s34 = string.Empty, s44 = string.Empty, s48 = string.Empty;
            TEnvirnoment Envir;
            List<TPlayObject> List58;
            List<TBaseObject> List59;
            TPlayObject User;
            string sName = string.Empty;
            TPlayObject OnlinePlayObject;
            TGuildRank GuildRank;
            TPlayObject UserObject = null;
            int CMDCode = 0;
            try
            {
                if (ActionList == null)
                {
                    return result;
                }
                if (ActionList.Count > 0)
                {
                    for (I = 0; I < ActionList.Count; I++)
                    {
                        QuestActionInfo = ActionList[I];
                        if (QuestActionInfo != null)
                        {
                            CMDCode = QuestActionInfo.nCMDCode;
                            switch (QuestActionInfo.nCMDCode)
                            {
                                case M2Share.nSET:
                                    n28 = HUtil32.Str_ToInt(QuestActionInfo.sParam1, 0);
                                    n2C = HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0);
                                    PlayObject.SetQuestFlagStatus(n28, n2C);
                                    break;
                                case M2Share.nTAKE:
                                    GotoLable_TakeItem(PlayObject, QuestActionInfo.sParam1, QuestActionInfo.nParam2, QuestActionInfo.sParam2, QuestActionInfo.sParam3);
                                    break;
                                case M2Share.nSC_GIVE:
                                    ActionOfGiveItem(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nTAKEW:
                                    if ((QuestActionInfo.sParam1 != "") && (QuestActionInfo.sParam1[0] == '<') && (QuestActionInfo.sParam1[1] == '$'))
                                    {
                                        s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    if ((QuestActionInfo.sParam2 != "") && (QuestActionInfo.sParam2[0] == '<') && (QuestActionInfo.sParam2[1] == '$'))
                                    {
                                        n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref n14))
                                    {
                                        n14 = QuestActionInfo.nParam2;
                                    }
                                    GotoLable_TakeWItem(PlayObject, s4C, n14);
                                    break;
                                case M2Share.nCLOSE:
                                    PlayObject.SendMsg(this, Grobal2.RM_MERCHANTDLGCLOSE, 0, this.ToInt(), 0, 0, "");
                                    break;
                                case M2Share.nRESET:
                                    if (QuestActionInfo.nParam2 <= 0)
                                    {
                                        QuestActionInfo.nParam2 = 1;
                                    }
                                    for (II = 0; II < QuestActionInfo.nParam2; II++)
                                    {
                                        PlayObject.SetQuestFlagStatus(QuestActionInfo.nParam1 + II, 0);
                                    }
                                    break;
                                case M2Share.nBREAK:
                                    if (QuestActionInfo.nParam1 != 0)
                                    {
                                        if ((QuestActionInfo.nParam1 == 1) || (QuestActionInfo.nParam1 == 2))
                                        {
                                            result = false;
                                        }
                                    }
                                    else
                                    {
                                        result = false;
                                    }
                                    break;
                                case M2Share.nTIMERECALL:
                                    PlayObject.m_boTimeRecall = true;
                                    PlayObject.m_sMoveMap = PlayObject.m_sMapName;
                                    PlayObject.m_nMoveX = PlayObject.m_nCurrX;
                                    PlayObject.m_nMoveY = PlayObject.m_nCurrY;
                                    PlayObject.m_dwTimeRecallTick = HUtil32.GetTickCount() + ((uint)QuestActionInfo.nParam1 * 60000);// 60 * 1000
                                    break;
                                case M2Share.nSC_PARAM1:
                                    n34 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                                    s44 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nSC_PARAM2:
                                    n38 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                                    s48 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nSC_PARAM3:
                                    n3C = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                                    s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nSC_PARAM4:
                                    n40 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                                    s50 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nSC_EXEACTION:
                                    n40 = QuestActionInfo.nParam1;
                                    s50 = QuestActionInfo.sParam1;
                                    ExeAction(PlayObject, QuestActionInfo.sParam1, QuestActionInfo.sParam2, QuestActionInfo.sParam3, QuestActionInfo.nParam1, QuestActionInfo.nParam2, (uint)QuestActionInfo.nParam3);
                                    break;
                                case M2Share.nMAPMOVE:
                                    if ((QuestActionInfo.sParam1 != "") && (QuestActionInfo.sParam1[0] == '<') && (QuestActionInfo.sParam1[1] == '$'))
                                    {
                                        s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    }
                                    else
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    if ((QuestActionInfo.sParam2 != "") && (QuestActionInfo.sParam2[0] == '<') && (QuestActionInfo.sParam2[1] == '$')) // 增加支持<$Str()>
                                    {
                                        n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref n14))
                                    {
                                        n14 = QuestActionInfo.nParam2;
                                    }
                                    if ((QuestActionInfo.sParam3 != "") && (QuestActionInfo.sParam3[0] == '<') && (QuestActionInfo.sParam3[1] == '$'))
                                    {
                                        n40 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam3, ref n40))
                                    {
                                        n40 = QuestActionInfo.nParam3;
                                    }
                                    PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                    PlayObject.SpaceMove(s4C, n14, n40, 0);
                                    bo11 = true;
                                    break;
                                case M2Share.nMAP:
                                    if ((QuestActionInfo.sParam1 != "") && (QuestActionInfo.sParam1[0] == '<') && (QuestActionInfo.sParam1[1] == '$'))
                                    {
                                        s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    }
                                    else
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                    PlayObject.MapRandomMove(s4C, 0);
                                    bo11 = true;
                                    break;
                                case M2Share.nTAKECHECKITEM:
                                    if (UserItem != null)
                                    {
                                        PlayObject.QuestTakeCheckItem(UserItem);
                                    }
                                    else
                                    {
                                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sTAKECHECKITEM);
                                    }
                                    break;
                                case M2Share.nMONGEN:// 扩展支持变量
                                    s34 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 怪物名
                                    n34 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);// 范围
                                    n40 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 1);// 数量
                                    for (II = 0; II < n40; II++)
                                    {
                                        n20X = HUtil32.Random(n34 * 2 + 1) + (n38 - n34);
                                        n24Y = HUtil32.Random(n34 * 2 + 1) + (n3C - n34);
                                        UserEngine.RegenMonsterByName(s44, n20X, n24Y, s34);// 地图,X,Y,名字
                                    }
                                    break;
                                case M2Share.nMONCLEAR:
                                    List59 = new List<TBaseObject>();
                                    s34 = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    UserEngine.GetMapMonster(M2Share.g_MapManager.FindMap(s34), List59);
                                    if (List59.Count > 0)
                                    {
                                        for (II = 0; II < List59.Count; II++)
                                        {
                                            List59[II].m_boNoItem = true;
                                            List59[II].m_WAbil.HP = 0;
                                        }
                                    }
                                    Dispose(List59);
                                    break;
                                case M2Share.nMOV:
                                    GotoLable_MovData(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nINC:
                                    GotoLable_IncInteger(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nDEC:
                                    GotoLable_DecInteger(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSUM:
                                    n18 = 0;
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6)) // SUM 支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    if (!GetVarValues(PlayObject, n14, ref n18, ref s44))
                                    {
                                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSUM);
                                    }
                                    n1C = 0;
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam2, "<$STR(", 6))// SUM 支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam2, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam2);
                                    }
                                    if (!GetVarValues(PlayObject, n14, ref n18, ref s44))
                                    {
                                       ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSUM);
                                    }
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))// SUM 支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    if (n14 >= 0)
                                    {
                                        SetVarValues(PlayObject, n14, n18 + n1C, s44 + s48);
                                    }
                                    break;
                                case M2Share.nSC_DIV:// 变量运算 除法  格式: DIV N1 N2 N3 即N1=N2/N3
                                    n18 = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam2);
                                        if (!GetVarValues(PlayObject, n14, ref n18, ref s44))
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DIV);
                                        }
                                        if (!string.IsNullOrEmpty(s44)) //不能对字符串进行除法运算
                                        {
                                            ScriptActionError(PlayObject, "无法对字符串进行除法运算", QuestActionInfo, M2Share.sSC_DIV);
                                        }
                                    }
                                    else
                                    {
                                        n18 = n14;
                                    }
                                    n1C = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam3);
                                        if (!GetVarValues(PlayObject, n14, ref n18, ref s44))
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_DIV);
                                        }
                                        if (!string.IsNullOrEmpty(s44)) //不能对字符串进行除法运算
                                        {
                                            ScriptActionError(PlayObject, "无法对字符串进行除法运算", QuestActionInfo, M2Share.sSC_DIV);
                                        }
                                    }
                                    else
                                    {
                                        n1C = n14;
                                    }
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6)) // 支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    if (n14 >= 0)
                                    {
                                        SetVarValues(PlayObject, n14, n18 / n1C, null);
                                    }
                                    break;
                                case M2Share.nSC_MUL:// 变量运算 乘法  格式: MUL N1 N2 N3 即N1=N2*N3
                                    n18 = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam2);
                                        if (!GetVarValues(PlayObject, n14, ref n18, ref s44))
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MUL);
                                        }
                                        if (!string.IsNullOrEmpty(s44))  //对字符串变量进行处理
                                        {
                                            if (HUtil32.rangeInDefined(n14, 600, 699))
                                            {
                                                n18 = HUtil32.Str_ToInt(PlayObject.m_sString[n14 - 600], 1);
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 700, 799))
                                            {
                                                n18 = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n14 - 700], 1);
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 800, 1199))
                                            {
                                                n18 = M2Share.g_Config.GlobalVal[n14 - 700];
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 1200, 1599))
                                            {
                                                n18 = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n14 - 1100], 1);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        n18 = n14;
                                    }
                                    n1C = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam3);
                                        if (!GetVarValues(PlayObject, n14, ref n1C, ref s44))
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MUL);
                                        }
                                        if (!string.IsNullOrEmpty(s44))  //对字符串变量进行处理
                                        {
                                            if (HUtil32.rangeInDefined(n14, 600, 699))
                                            {
                                                n1C = HUtil32.Str_ToInt(PlayObject.m_sString[n14 - 600], 1);
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 700, 799))
                                            {
                                                n1C = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n14 - 700], 1);
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 800, 1199))
                                            {
                                                n1C = M2Share.g_Config.GlobalVal[n14 - 700];
                                            }
                                            else if (HUtil32.rangeInDefined(n14, 1200, 1599))
                                            {
                                                n1C = HUtil32.Str_ToInt(M2Share.g_Config.GlobalAVal[n14 - 1100], 1);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        n1C = n14;
                                    }
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))   //  支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    // 取第一个变量,并传值给n18
                                    if (n14 >= 0)
                                    {
                                        SetVarValues(PlayObject, n14, n18 * n1C, Convert.ToString(n18 * n1C));
                                    }
                                    break;
                                case M2Share.nSC_PERCENT:// 变量运算 百分比  格式: PERCENT N1 N2 N3 即N1=(N2/N3)*100
                                    n18 = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam2);// 取第一个变量,并传值给n18
                                        if (n14 >= 0)
                                        {
                                            switch (n14)
                                            {
                                                // Modify the A .. B: 0 .. 99
                                                case 0:
                                                    // 20080323 原为0..99
                                                    n18 = PlayObject.m_nVal[n14];
                                                    break;
                                                // Modify the A .. B: 100 .. 199
                                                case 100:
                                                    n18 = M2Share.g_Config.GlobalVal[n14 - 100];
                                                    break;
                                                // Modify the A .. B: 200 .. 299
                                                case 200:
                                                    // 20080323 原为200..209
                                                    n18 = PlayObject.m_DyVal[n14 - 200];
                                                    break;
                                                // Modify the A .. B: 300 .. 399
                                                case 300:
                                                    n18 = PlayObject.m_nMval[n14 - 300];
                                                    break;
                                                // Modify the A .. B: 400 .. 499
                                                case 400:
                                                    n18 = M2Share.g_Config.GlobaDyMval[n14 - 400];
                                                    break;
                                                // Modify the A .. B: 500 .. 599
                                                case 500:
                                                    n18 = PlayObject.m_nInteger[n14 - 500];
                                                    break;
                                                // Modify the A .. B: 800 .. 1199
                                                case 800:
                                                    // 20080903 G变量
                                                    n18 = M2Share.g_Config.GlobalVal[n14 - 700];
                                                    break;
                                                default:
                                                    // 1800..2799:begin//20080323 I变量
                                                    // n18 := g_Config.GlobaDyMval[n14 - 1800];
                                                    // end;
                                                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_PERCENT);
                                                    break;
                                            }
                                            // case
                                        }
                                        else
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_PERCENT);
                                        }
                                    }
                                    else
                                    {
                                        n18 = n14;
                                    }
                                    n1C = 0;
                                    n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                                    if (n14 < 0)
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam3);// 取第一个变量,并传值给n1C
                                        if (n14 >= 0)
                                        {
                                            switch (n14)
                                            {
                                                // Modify the A .. B: 0 .. 99
                                                case 0:// 原为0..99
                                                    n1C = PlayObject.m_nVal[n14];
                                                    break;
                                                // Modify the A .. B: 100 .. 199
                                                case 100:
                                                    n1C = M2Share.g_Config.GlobalVal[n14 - 100];
                                                    break;
                                                // Modify the A .. B: 200 .. 299
                                                case 200://  原为200..209
                                                    n1C = PlayObject.m_DyVal[n14 - 200];
                                                    break;
                                                // Modify the A .. B: 300 .. 399
                                                case 300:
                                                    n1C = PlayObject.m_nMval[n14 - 300];
                                                    break;
                                                // Modify the A .. B: 400 .. 499
                                                case 400:
                                                    n1C = M2Share.g_Config.GlobaDyMval[n14 - 400];
                                                    break;
                                                // Modify the A .. B: 500 .. 599
                                                case 500:
                                                    n1C = PlayObject.m_nInteger[n14 - 500];
                                                    break;
                                                // Modify the A .. B: 800 .. 1199
                                                case 800:// G变量
                                                    n1C = M2Share.g_Config.GlobalVal[n14 - 700];
                                                    break;
                                                default:
                                                    // 1800..2799:begin//20080323 I变量
                                                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_PERCENT);
                                                    break;
                                            }
                                        }
                                        else
                                        {
                                            // ScriptActionError(PlayObject,'',QuestActionInfo,sSC_PERCENT);
                                        }
                                    }
                                    else
                                    {
                                        n1C = n14;
                                    }
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))
                                    {
                                        // 支持字符串变量
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    if (n14 >= 0)
                                    {
                                        switch (n14)
                                        {
                                            // Modify the A .. B: 0 .. 99
                                            case 0:
                                                // 20080323 原为0..99
                                                PlayObject.m_nVal[n14] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 100 .. 199
                                            case 100:
                                                M2Share.g_Config.GlobalVal[n14 - 100] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 200 .. 299
                                            case 200:
                                                // 20080323 原为200..209
                                                PlayObject.m_DyVal[n14 - 200] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 300 .. 399
                                            case 300:
                                                PlayObject.m_nMval[n14 - 300] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 400 .. 499
                                            case 400:
                                                M2Share.g_Config.GlobaDyMval[n14 - 400] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 500 .. 599
                                            case 500:
                                                PlayObject.m_nInteger[n14 - 500] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 600 .. 699
                                            case 600:
                                                PlayObject.m_sString[n14 - 600] = (n18 / n1C * 100).ToString() + "%";
                                                break;
                                            // 20080606
                                            // Modify the A .. B: 700 .. 799
                                            case 700:
                                                M2Share.g_Config.GlobalAVal[n14 - 700] = (n18 / n1C * 100).ToString() + "%";
                                                break;
                                            // 20080606
                                            // Modify the A .. B: 800 .. 1199
                                            case 800:
                                                // 20080903 G变量
                                                M2Share.g_Config.GlobalVal[n14 - 700] = n18 / n1C * 100;
                                                break;
                                            // Modify the A .. B: 1200 .. 1599
                                            case 1200:
                                                // 20080903 A变量(100-499)
                                                M2Share.g_Config.GlobalAVal[n14 - 1100] = (n18 / n1C * 100).ToString() + "%";
                                                break;
                                        }
                                    }
                                    break;
                                case M2Share.nBREAKTIMERECALL:
                                    PlayObject.m_boTimeRecall = false;
                                    break;
                                case M2Share.nPKPOINT:
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref n14))
                                    {
                                        n14 = QuestActionInfo.nParam1;
                                    }
                                    if (n14 == 0)
                                    {
                                        PlayObject.m_nPkPoint = 0;
                                    }
                                    else
                                    {
                                        if (n14 < 0)
                                        {
                                            if ((PlayObject.m_nPkPoint + n14) >= 0)
                                            {
                                                PlayObject.m_nPkPoint += n14;
                                            }
                                            else
                                            {
                                                PlayObject.m_nPkPoint = 0;
                                            }
                                        }
                                        else
                                        {
                                            if ((PlayObject.m_nPkPoint + n14) > 10000)
                                            {
                                                PlayObject.m_nPkPoint = 10000;
                                            }
                                            else
                                            {
                                                PlayObject.m_nPkPoint += n14;
                                            }
                                        }
                                    }
                                    PlayObject.RefNameColor();
                                    break;
                                case M2Share.nSC_RECALLMOB:
                                    ActionOfRecallmob(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_RECALLMOBEX:// 召唤宝宝
                                    ActionOfRecallMobex(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MOVEMOBTO:// 将指定坐标的怪物移动到新坐标
                                    ActionOfMoveMobto(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARITEMMAP:// 清除地图物品
                                    ActionOfClearItemMap(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nKICK:
                                    PlayObject.m_boReconnection = true;
                                    PlayObject.m_boSoftClose = true;
                                    PlayObject.m_boPlayOffLine = false;
                                    PlayObject.m_boNotOnlineAddExp = false;
                                    break;
                                case M2Share.nMOVR:// 取随机值赋给变量   拓展可以随机参数2到参数3之间的数
                                    if (HUtil32.CompareLStr(QuestActionInfo.sParam1, "<$STR(", 6))// 支持字符串变量
                                    {
                                        HUtil32.ArrestStringEx(QuestActionInfo.sParam1, "(", ")", ref s34);
                                        n14 = M2Share.GetValNameNo(s34);
                                    }
                                    else
                                    {
                                        n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    }
                                    if (n14 >= 0)
                                    {
                                        if (HUtil32.rangeInDefined(n14, 0, 99))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                PlayObject.m_nVal[n14] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                PlayObject.m_nVal[n14] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 100, 199))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                M2Share.g_Config.GlobalVal[n14 - 100] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                M2Share.g_Config.GlobalVal[n14 - 100] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 200, 299))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                PlayObject.m_DyVal[n14 - 200] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                PlayObject.m_DyVal[n14 - 200] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 300, 399))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                PlayObject.m_nMval[n14 - 300] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                PlayObject.m_nMval[n14 - 300] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 400, 499))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                M2Share.g_Config.GlobaDyMval[n14 - 400] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                M2Share.g_Config.GlobaDyMval[n14 - 400] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 500, 599))
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                PlayObject.m_nInteger[n14 - 500] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                PlayObject.m_nInteger[n14 - 500] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else if (HUtil32.rangeInDefined(n14, 800, 1199))//G变量
                                        {
                                            if (QuestActionInfo.nParam3 > QuestActionInfo.nParam2)
                                            {
                                                M2Share.g_Config.GlobalVal[n14 - 700] = QuestActionInfo.nParam2 + HUtil32.Random(QuestActionInfo.nParam3 - QuestActionInfo.nParam2);
                                            }
                                            else
                                            {
                                                M2Share.g_Config.GlobalVal[n14 - 700] = HUtil32.Random(QuestActionInfo.nParam2);
                                            }
                                        }
                                        else{
                                               ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOVR);
                                        }
                                    }
                                    else
                                    {
                                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sMOVR);
                                    }
                                    break;
                                case M2Share.nEXCHANGEMAP:// 两角色互换地图
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                    {
                                        s4C = QuestActionInfo.sParam1;// 地图名称
                                    }
                                    if ((s4C).ToLower().CompareTo(("APPR").ToLower()) == 0) // 师徒地图互换
                                    {
                                        User = UserEngine.GetPlayObject(PlayObject.m_sMasterName);
                                        if (User != null)
                                        {
                                            s4C = User.m_sMapName;
                                            User.MapRandomMove(PlayObject.m_sMapName, 0);
                                            PlayObject.MapRandomMove(s4C, 0);
                                        }
                                    }
                                    else if ((s4C).ToLower().CompareTo(("DEAR").ToLower()) == 0) // 夫妻地图互换
                                    {
                                        if (PlayObject.m_DearHuman != null)
                                        {
                                            s4C = PlayObject.m_DearHuman.m_sMapName;
                                            PlayObject.m_DearHuman.MapRandomMove(PlayObject.m_sMapName, 0);
                                            PlayObject.MapRandomMove(s4C, 0);
                                        }
                                    }
                                    else
                                    {
                                        Envir = M2Share.g_MapManager.FindMap(s4C);
                                        if (Envir != null)
                                        {
                                            List58 = new List<TPlayObject>();
                                            UserEngine.GetMapRageHuman(Envir, 0, 0, 1000, List58);
                                            if (List58.Count > 0)
                                            {
                                                User = List58[0];
                                                User.MapRandomMove(this.m_sMapName, 0);
                                            }
                                            Dispose(List58);
                                            PlayObject.MapRandomMove(s4C, 0);
                                        }
                                        else
                                        {
                                            ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sEXCHANGEMAP);
                                        }
                                    }
                                    break;
                                case M2Share.nRECALLMAP:
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    Envir = M2Share.g_MapManager.FindMap(s4C);
                                    if (Envir != null)
                                    {
                                        List58 = new List<TPlayObject>();
                                        UserEngine.GetMapRageHuman(Envir, 0, 0, 1000, List58);
                                        if (List58.Count > 0)
                                        {
                                            for (II = 0; II < List58.Count; II++)
                                            {
                                                User = List58[II];
                                                User.MapRandomMove(this.m_sMapName, 0);
                                                if (II > 20)
                                                {
                                                    break;
                                                }
                                            }
                                        }
                                        Dispose(List58);
                                    }
                                    else
                                    {
                                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sRECALLMAP);
                                    }
                                    break;
                                case M2Share.nADDBATCH:
                                    //List1C.Add(QuestActionInfo.sParam1, ((n18) as Object));
                                    break;
                                case M2Share.nBATCHDELAY:
                                    n18 = QuestActionInfo.nParam1 * 1000;
                                    break;
                                case M2Share.nBATCHMOVE:
                                    //if (List1C.Count > 0)
                                    //{
                                    //    for (II = 0; II < List1C.Count; II ++ )
                                    //    {
                                    //        PlayObject.SendDelayMsg(this, Grobal2.RM_10155, 0, 0, 0, 0, List1C[II], ((int)List1C.Values[II]) + n20);
                                    //        n20 += ((int)List1C.Values[II]);
                                    //    }
                                    //}
                                    break;
                                case M2Share.nPLAYDICE:
                                    PlayObject.m_sPlayDiceLabel = QuestActionInfo.sParam2;
                                    PlayObject.SendMsg(this, Grobal2.RM_PLAYDICE, QuestActionInfo.nParam1, HUtil32.MakeLong(HUtil32.MakeWord((byte)PlayObject.m_DyVal[0],
                                        (byte)PlayObject.m_DyVal[1]), HUtil32.MakeWord((byte)PlayObject.m_DyVal[2], (byte)PlayObject.m_DyVal[3])),
                                        HUtil32.MakeLong(HUtil32.MakeWord((byte)PlayObject.m_DyVal[4], (byte)PlayObject.m_DyVal[5]), HUtil32.MakeWord((byte)PlayObject.m_DyVal[6], (byte)PlayObject.m_DyVal[7])),
                                        HUtil32.MakeLong(HUtil32.MakeWord((byte)PlayObject.m_DyVal[8], (byte)PlayObject.m_DyVal[9]), 0), QuestActionInfo.sParam2);
                                    bo11 = true;
                                    break;
                                case M2Share.nSetOnTimer:// 个人定时器(开启)
                                    if (PlayObject != null)
                                    {
                                        n28 = HUtil32.Str_ToInt(QuestActionInfo.sParam1, 0);
                                        n2C = HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0);
                                        n28 = n28 % 10;
                                        if ((n28 > 9) || (n28 < 0))
                                        {
                                            n28 = 0;
                                        }
                                        PlayObject.AutoTimerStatus[n28] = n2C * 1000;
                                        PlayObject.AutoTimerTick[n28] = HUtil32.GetTickCount();
                                    }
                                    break;
                                case M2Share.nSETOFFTIMER:// 停止定时器
                                    if (PlayObject != null)
                                    {
                                        n28 = HUtil32.Str_ToInt(QuestActionInfo.sParam1, 0);
                                        n28 = n28 % 10;
                                        if ((n28 > 9) || (n28 < 0))
                                        {
                                            n28 = 0;
                                        }
                                        PlayObject.AutoTimerStatus[n28] = 0;
                                    }
                                    break;
                                case M2Share.nADDNAMELIST:
                                    GotoLable_AddList(PlayObject.m_sCharName, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nDELNAMELIST:
                                    GotoLable_DelList(PlayObject.m_sCharName, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nADDGUILDLIST:
                                    if (PlayObject.m_MyGuild != null)
                                    {
                                        GotoLable_AddList(PlayObject.m_MyGuild.sGuildName, m_sPath + QuestActionInfo.sParam1);
                                    }
                                    break;
                                case M2Share.nDELGUILDLIST:
                                    if (PlayObject.m_MyGuild != null)
                                    {
                                        GotoLable_DelList(PlayObject.m_MyGuild.sGuildName, m_sPath + QuestActionInfo.sParam1);
                                    }
                                    break;
                                case M2Share.nSENDMSG:// 发送文字信息
                                    ActionOfLineMsg(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nCREATEFILE:// 创建文本文件
                                    ActionOfCreateFile(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSENDTOPMSG://特殊公告
                                    ActionOfSendTopMsg(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSENDCENTERMSG:// 顶端滚动公告
                                    ActionOfSendCenterMsg(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSENDEDITTOPMSG:// 屏幕居中显示公告 聊天框顶端公告
                                    ActionOfSendEditTopMsg(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nOPENMAKEWINE:// 打开酿酒窗口
                                    ActionOfOPENMAKEWINE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGETGOODMAKEWINE://  取回酿好的酒 
                                    ActionOfGETGOODMAKEWINE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nDECMAKEWINETIME://减少酿酒的时间 
                                    ActionOfDECMAKEWINETIME(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nREADSKILLNG:// 学习内功 
                                    ActionOfREADSKILLNG(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nMAKEWINENPCMOVE:// 酿酒NPC的走动 
                                    ActionOfMAKEWINENPCMOVE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nFOUNTAIN:// 设置泉水喷发 
                                    ActionOfFOUNTAIN(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSETGUILDFOUNTAIN:// 开启/关闭行会泉水仓库 
                                    ActionOfSETGUILDFOUNTAIN(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGIVEGUILDFOUNTAIN:// 领取行会酒水
                                    ActionOfGIVEGUILDFOUNTAIN(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nCHALLENGMAPMOVE:// 挑战地图移动
                                    // ------------------------------------------------------------------------------
                                    ActionOfCHALLENGMAPMOVE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGETCHALLENGEBAKITEM://没有挑战地图可移动,则退回抵押的物品 
                                    ActionOfGETCHALLENGEBAKITEM(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nHEROLOGOUT:// 人物在线英雄下线 
                                    // ------------------------------------------------------------------------------
                                    ActionOfHEROLOGOUT(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGETSORTNAME://  取指定排行榜指定排名的玩家名字
                                    ActionOfGETSORTNAME(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nWEBBROWSER://连接指定网站网址
                                    ActionOfWEBBROWSER(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nKICKALLPLAY:// 踢除服务器所有人物
                                    ActionOfKICKALLPLAY(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nREPAIRALL:// 修理全身装备
                                    ActionOfRepairAll(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nCHANGESKILL:// 功能:修改魔法ID 20080624
                                    ActionOfCHANGESKILL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nAUTOGOTOXY:// 自动寻路 20080617
                                    ActionOfAUTOGOTOXY(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nADDATTACKSABUKALL:// 设置所有行会攻城
                                    ActionOfADDATTACKSABUKALL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nOPENBOOKS:// 卧龙
                                    ActionOfOPENBOOKS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nOPENYBDEAL:// 开通元宝交易
                                    ActionOfOPENYBDEAL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nQUERYYBSELL:// 查询正在出售的物品
                                    ActionOfQUERYYBSELL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nQUERYYBDEAL:// 查询可以的购买物品
                                    ActionOfQueryYbDeal(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nTHROUGHHUM:// 改变穿人模式
                                    ActionOfTHROUGHHUM(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSETITEMSLIGHT:// 装备发光设置
                                    ActionOfSetItemsLight(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nOPENDRAGONBOX:// 打开卧龙宝藏
                                    ActionOfOpenDragonBox(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nQUERYREFINEITEM:// 打开淬炼窗口
                                    ActionOfQUERYREFINEITEM(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGOHOME://  移动到回城点
                                    ActionOfGOHOME(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nTHROWITEM://将指定物品刷新到指定地图坐标范围内 
                                    ActionOfTHROWITEM(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nCLEARCODELIST:// 删除指定文本里的编码
                                    ActionOfCLEARCODELIST(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGETRANDOMNAME:// 从文件中随机取文本
                                    ActionOfGetRandomName(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nHCall://  通过脚本命令让别人执行QManage.txt中的脚本
                                    ActionOfHCall(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nINCASTLEWARAY:// 检测人物是否在攻城期间的范围内，在则BB叛变
                                    ActionOfINCASTLEWARAY(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nGIVESTATEITEM:// 给予带绑定状态装备
                                    ActionOfGIVESTATEITEM(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSETITEMSTATE:// 设置装备绑定状态
                                    ActionOfSETITEMSTATE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nADDACCOUNTLIST:
                                    GotoLable_AddList(PlayObject.m_sUserID, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nDELACCOUNTLIST:
                                    GotoLable_DelList(PlayObject.m_sUserID, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nADDIPLIST:
                                    GotoLable_AddList(PlayObject.m_sIPaddr, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nDELIPLIST:
                                    GotoLable_DelList(PlayObject.m_sIPaddr, m_sPath + QuestActionInfo.sParam1);
                                    break;
                                case M2Share.nGOQUEST:
                                    GotoLable_GoToQuest(PlayObject, QuestActionInfo.nParam1);
                                    break;
                                case M2Share.nENDQUEST:
                                    PlayObject.m_Script = null;
                                    break;
                                case M2Share.nGOTO:
                                    if (!GotoLable_JmpToLable(PlayObject, QuestActionInfo.sParam1))
                                    {
                                        M2Share.MainOutMessage("[脚本死循环] NPC:" + this.m_sCharName + " 位置:" + this.m_sMapName 
                                            + "(" + (this.m_nCurrX).ToString() + ":" + (this.m_nCurrY).ToString() + ")" + " 命令:" 
                                            + M2Share.sGOTO + " " + QuestActionInfo.sParam1);
                                        result = false;
                                        return result;
                                    }
                                    break;
                                case M2Share.nSC_HAIRSTYLE:
                                    ActionOfChangeHairStyle(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARNAMELIST:
                                    ActionOfClearNameList(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGELEVEL:
                                    ActionOfChangeLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MARRY:
                                    ActionOfMarry(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MASTER:
                                    ActionOfMaster(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_UNMASTER:
                                    ActionOfUnMaster(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_UNMARRY:
                                    ActionOfUnMarry(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GETMARRY:
                                    ActionOfGetMarry(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GETMASTER:
                                    ActionOfGetMaster(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARSKILL:
                                    ActionOfClearSkill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELNOJOBSKILL:
                                    ActionOfDelNoJobSkill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELSKILL:
                                    ActionOfDelSkill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ADDSKILL:
                                    ActionOfAddSkill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ADDGUILDMEMBER: // 添加行会成员
                                    ActionOfADDGUILDMEMBER(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELGUILDMEMBER:// 删除行会成员（删除掌门无效
                                    ActionOfDelGuildMember(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SKILLLEVEL:// 调整人物技能等级
                                    ActionOfSkillLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_HEROSKILLLEVEL:// 调整英雄技能等级 20080415
                                    ActionOfHeroSkillLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEPKPOINT:
                                    ActionOfChangePkPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEEXP:
                                    ActionOfChangeExp(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGENGEXP:// 调整内功经验
                                    ActionOfChangeNGExp(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGENGLEVEL: // 调整内功等级
                                    ActionOfCHANGENGLEVEL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENEXPCRYSTAL:// 客户端显示天地结晶
                                    ActionOfOPENEXPCRYSTAL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLOSEEXPCRYSTAL:// 客户端关闭天地结晶
                                    ActionOfCLOSEEXPCRYSTAL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GETEXPTOCRYSTAL:// 取提天地结晶中的经验(只提取可提取的经验)
                                    ActionOfGETEXPTOCRYSTAL(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SENDTIMEMSG: // 时间到解发脚本段(客户端显示时间)
                                    ActionOfSENDTIMEMSG(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SENDMSGWINDOWS:// 时间到解发脚本段
                                    ActionOfSENDMSGWINDOWS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLOSEMSGWINDOWS:// 关闭客户端'!'图标的显示
                                    ActionOfCLOSEMSGWINDOWS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GETGROUPCOUNT:
                                    ActionOfGETGROUPCOUNT(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEJOB:// 取组队成员数
                                    ActionOfChangeJob(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MISSION:
                                    ActionOfMission(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MOBPLACE:
                                    ActionOfMobPlace(PlayObject, QuestActionInfo, n34, n38, n3C, n40);
                                    break;
                                case M2Share.nSC_SETMEMBERTYPE:
                                    ActionOfSetMemberType(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETMEMBERLEVEL:
                                    ActionOfSetMemberLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GAMEGOLD:
                                    ActionOfGameGold(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GAMEDIAMOND: // 金刚石
                                    ActionOfGameDiaMond(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GAMEGIRD:// 灵符 
                                    ActionOfGameGird(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHUMABILITY:// 调整人物属性 
                                    ActionOfCHANGEHUMABILITY(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROLOYAL:// 调整英雄的忠诚度 
                                    ActionOfHeroLoyal(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROTRANPOINT:// 调整英雄技能升级点数
                                    ActionOfCHANGEHEROTRANPOINT(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SAVEHERO: // 寄放英雄
                                    // ----------------------酒馆系统-----------------------------------------------
                                    ActionOfSAVEHERO(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GETHERO:// 取回英雄
                                    ActionOfGETHERO(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLOSEDRINK: // 关闭斗酒窗口
                                    ActionOfCLOSEDRINK(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_PLAYDRINKMSG: // 斗酒窗口说话信息
                                    ActionOfPLAYDRINKMSG(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENPLAYDRINK:// 指定人物喝酒
                                    ActionOfOPENPLAYDRINK(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GAMEPOINT:
                                    // -----------------------------------------------------------------------------
                                    ActionOfGamePoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_AUTOADDGAMEGOLD:
                                    ActionOfAutoAddGameGold(PlayObject, QuestActionInfo, n34, (uint)n38);
                                    break;
                                case M2Share.nSC_AUTOSUBGAMEGOLD:
                                    ActionOfAutoSubGameGold(PlayObject, QuestActionInfo, n34, n38);
                                    break;
                                case M2Share.nSC_CHANGENAMECOLOR:
                                    ActionOfChangeNameColor(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARPASSWORD:
                                    ActionOfClearPassword(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_RENEWLEVEL:
                                    ActionOfReNewLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_KILLSLAVE:
                                    ActionOfKillSlave(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEGENDER:
                                    ActionOfChangeGender(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_KILLMONEXPRATE:
                                    ActionOfKillMonExpRate(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_POWERRATE:// 设置攻击力倍数
                                    ActionOfPowerRate(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEMODE:// 改变管理模式
                                    ActionOfChangeMode(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEPERMISSION:
                                    ActionOfChangePerMission(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_KILL:
                                    ActionOfKill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_KICK:
                                    ActionOfKick(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_BONUSPOINT:
                                    ActionOfBonusPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_RESTRENEWLEVEL:
                                    ActionOfRestReNewLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELMARRY:
                                    ActionOfDelMarry(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELMASTER:
                                    ActionOfDelMaster(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CREDITPOINT:
                                    ActionOfChangeCreditPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEGUILDMEMBERCOUNT:// 调整行会成员上限
                                    ActionOfCHANGEGUILDMEMBERCOUNT(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEGUILDFOUNTAIN:// 调整行会酒泉
                                    ActionOfCHANGEGUILDFOUNTAIN(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAGMAPINFO:// 记路标石
                                    ActionOfTAGMAPINFO(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAGMAPMOVE: // 移动到记路标石记录的地图XY
                                    ActionOfTAGMAPMOVE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GAMEGLORY:// 调整荣誉值
                                    ActionOfChangeCreditGlory(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARNEEDITEMS:
                                    ActionOfClearNeedItems(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARMAEKITEMS:
                                    ActionOfClearMakeItems(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETSENDMSGFLAG:
                                    PlayObject.m_boSendMsgFlag = true;
                                    break;
                                case M2Share.nSC_UPGRADEITEMS:
                                    ActionOfUpgradeItems(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_UPGRADEITEMSEX:
                                    ActionOfUpgradeItemsEx(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GIVEMINE:  //给矿石
                                    ActionOfGIVEMINE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MONGENEX:
                                    ActionOfMonGenEx(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARMAPMON:
                                    ActionOfClearMapMon(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETMAPMODE:
                                    ActionOfSetMapMode(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_PKZONE:
                                    ActionOfPkZone(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_RESTBONUSPOINT:
                                    ActionOfRestBonusPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAKECASTLEGOLD:
                                    ActionOfTakeCastleGold(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_HUMANHP:
                                    ActionOfHumanHP(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_HUMANMP:
                                    ActionOfHumanMP(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_BUILDPOINT:
                                    ActionOfGuildBuildPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_AURAEPOINT:
                                    ActionOfGuildAuraePoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_STABILITYPOINT:
                                    ActionOfGuildstabilityPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_FLOURISHPOINT:
                                    ActionOfGuildFlourishPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENMAGICBOX:
                                    ActionOfOpenMagicBox(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETRANKLEVELNAME:
                                    ActionOfSetRankLevelName(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GMEXECUTE:
                                    ActionOfGmExecute(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GUILDCHIEFITEMCOUNT:
                                    ActionOfGuildChiefItemCount(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ADDUSERDATE:
                                    ActionOfAddNameDateList(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELUSERDATE:
                                    ActionOfDelNameDateList(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MOBFIREBURN:
                                    ActionOfMobFireBurn(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_MESSAGEBOX:
                                    ActionOfMessageBox(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETSCRIPTFLAG:
                                    ActionOfSetScriptFlag(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SETAUTOGETEXP:
                                    ActionOfAutoGetExp(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_VAR:
                                    ActionOfVar(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_LOADVAR:
                                    ActionOfLoadVar(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_SAVEVAR:
                                    ActionOfSaveVar(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CALCVAR:
                                    ActionOfCalcVar(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nOFFLINEPLAY:
                                    ActionOfNotLineAddPiont(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nKICKOFFLINE:
                                    ActionOfKickNotLineAddPiont(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSTARTTAKEGOLD:
                                    ActionOfStartTakeGold(PlayObject);
                                    break;
                                case M2Share.nDELAYGOTO:// 延时跳转
                                    PlayObject.m_boTimeGoto = true;
                                    m_DelayGoto = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), 0);
                                    if (m_DelayGoto == 0)
                                    {
                                        GetValValue(PlayObject, QuestActionInfo.sParam1, ref n20);
                                        m_DelayGoto = n20;
                                    }
                                    if (m_DelayGoto > 0)
                                    {
                                        PlayObject.m_dwTimeGotoTick = HUtil32.GetTickCount() + (uint)m_DelayGoto;
                                    }
                                    else
                                    {
                                        PlayObject.m_dwTimeGotoTick = HUtil32.GetTickCount() + (uint)QuestActionInfo.nParam1;
                                    }
                                    PlayObject.m_sTimeGotoLable = QuestActionInfo.sParam2;// 改成毫秒
                                    PlayObject.m_TimeGotoNPC = (TMerchant)this;
                                    break;
                                case M2Share.nCLEARDELAYGOTO:
                                    PlayObject.m_boTimeGoto = false;
                                    PlayObject.m_sTimeGotoLable = "";
                                    PlayObject.m_TimeGotoNPC = null;
                                    break;
                                case M2Share.nSC_ANSIREPLACETEXT:
                                    ActionOfAnsiReplaceText(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ENCODETEXT:
                                    ActionOfEncodeText(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ADDTEXTLIST:
                                    s50 = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);// 文件路径支持变量
                                    if (s50[0] == '\\')
                                    {
                                        s50 = s50.Substring(2 - 1, s50.Length - 1);
                                    }
                                    if (s50[1] == '\\')
                                    {
                                        s50 = s50.Substring(3 - 1, s50.Length - 2);
                                    }
                                    if (s50[1] == '\\')
                                    {
                                        s50 = s50.Substring(4 - 1, s50.Length - 3);
                                    }
                                    s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    if (s4C == "")
                                    {
                                        if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                        {
                                            s4C = QuestActionInfo.sParam1;
                                        }
                                    }
                                    GotoLable_AddList(s4C, s50);
                                    break;
                                case M2Share.nSC_DELTEXTLIST:
                                    s50 = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);// 文件路径支持变量
                                    if (s50[0] == '\\')
                                    {
                                        s50 = s50.Substring(2 - 1, s50.Length - 1);
                                    }
                                    //增加,处理文件路径
                                    if (s50[1] == '\\')
                                    {
                                        s50 = s50.Substring(3 - 1, s50.Length - 2);
                                    }
                                    if (s50[2] == '\\')
                                    {
                                        s50 = s50.Substring(4 - 1, s50.Length - 3);
                                    }
                                    s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 变量
                                    if (s4C == "")
                                    {
                                        if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                        {
                                            s4C = QuestActionInfo.sParam1;
                                        }
                                    }
                                    GotoLable_DelList(s4C, s50);
                                    break;
                                case M2Share.nSC_GROUPMOVE:
                                    s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    if (s4C == "")
                                    {
                                        if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                        {
                                            // 增加变量支持
                                            s4C = QuestActionInfo.sParam1;
                                        }
                                    }
                                    if ((PlayObject.m_GroupOwner != null) && (PlayObject == PlayObject.m_GroupOwner))
                                    {
                                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count > 0)
                                        {
                                            for (II = 0; II < PlayObject.m_GroupOwner.m_GroupMembers.Count; II++)
                                            {
                                                //if ((!((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).m_boDeath) && (!((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).m_boGhost))
                                                //{
                                                //    ((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).MapRandomMove(s4C, 0);
                                                //}
                                            }
                                        }
                                        PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                        bo11 = true;
                                    }
                                    break;
                                case M2Share.nSC_GROUPMAPMOVE:// 组编传送,只有队长才能使用  增加触发段，所有成员可触发QF指定触发段
                                    if ((QuestActionInfo.sParam1 != "") && (QuestActionInfo.sParam1[0] == '<') && (QuestActionInfo.sParam1[1] == '$'))
                                    {
                                        s4C = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C)) // 地图号
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    if ((QuestActionInfo.sParam2 != "") && (QuestActionInfo.sParam2[0] == '<') && (QuestActionInfo.sParam2[1] == '$'))
                                    {
                                        n14 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), 0);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref n14))
                                    {
                                        n14 = QuestActionInfo.nParam2;
                                    }
                                    if ((QuestActionInfo.sParam3 != "") && (QuestActionInfo.sParam3[0] == '<') && (QuestActionInfo.sParam3[1] == '$'))
                                    {
                                        n40 = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), 0);
                                    }
                                    else if (!GetValValue(PlayObject, QuestActionInfo.sParam3, ref n40))
                                    {
                                        n40 = QuestActionInfo.nParam3;
                                    }
                                    if ((PlayObject.m_GroupOwner != null) && (PlayObject == PlayObject.m_GroupOwner))
                                    {
                                        if (PlayObject.m_GroupOwner.m_GroupMembers.Count > 0)
                                        {
                                            for (II = 0; II < PlayObject.m_GroupOwner.m_GroupMembers.Count; II++)
                                            {
                                                //if ((!((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).m_boDeath) && (!((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).m_boGhost))
                                                //{
                                                //    ((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])).SpaceMove(s4C, n14, n40, 0);
                                                //    if ((QuestActionInfo.sParam4 != ""))
                                                //    {
                                                //        // 是否设置触发段
                                                //        if ((M2Share.g_FunctionNPC != null))
                                                //        {
                                                //            M2Share.g_FunctionNPC.GotoLable(((TPlayObject)(PlayObject.m_GroupOwner.m_GroupMembers[II])), QuestActionInfo.sParam4, false);
                                                //        }
                                                //    }
                                                //}
                                            }
                                        }
                                        PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                        bo11 = true;
                                    }
                                    break;
                                case M2Share.nSC_RECALLHUMAN:
                                    s4C = QuestActionInfo.sParam1;
                                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C);
                                    if (s4C != "")
                                    {
                                        PlayObject.RecallHuman(s4C);
                                    }
                                    break;
                                case M2Share.nSC_REGOTO:
                                    s4C = QuestActionInfo.sParam1;
                                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C);
                                    if (s4C != "")
                                    {
                                        OnlinePlayObject = UserEngine.GetPlayObject(s4C);
                                        if (PlayObject != null)
                                        {
                                            PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                            PlayObject.SpaceMove(OnlinePlayObject.m_PEnvir.sMapName, OnlinePlayObject.m_nCurrX, OnlinePlayObject.m_nCurrY, 0);
                                            bo11 = true;
                                        }
                                    }
                                    break;
                                case M2Share.nSC_INTTOSTR:
                                    n40 = 0;
                                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref n40);
                                    n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    if (n14 >= 0)
                                    {
                                        switch (n14)
                                        {
                                            // Modify the A .. B: 600 .. 699
                                            case 600:
                                                PlayObject.m_sString[n14 - 600] = (n40).ToString();
                                                break;
                                            // Modify the A .. B: 700 .. 799
                                            case 700:
                                                M2Share.g_Config.GlobalAVal[n14 - 700] = (n40).ToString();
                                                break;
                                            // Modify the A .. B: 1200 .. 1599
                                            case 1200:// A变量(100-499)
                                                M2Share.g_Config.GlobalAVal[n14 - 1100] = (n40).ToString();
                                                break;
                                            default:
                                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_INTTOSTR);
                                                break;
                                        }
                                    }
                                    break;
                                case M2Share.nSC_STRTOINT:
                                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C);
                                    n14 = M2Share.GetValNameNo(QuestActionInfo.sParam1);
                                    if (n14 >= 0)
                                    {
                                        switch (n14)
                                        {
                                            // Modify the A .. B: 0 .. 99
                                            case 0:
                                                // 20080323 原为0..99
                                                PlayObject.m_nVal[n14] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 100 .. 199
                                            case 100:
                                                M2Share.g_Config.GlobalVal[n14 - 100] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 200 .. 299
                                            case 200:
                                                // 20080323 原为200..209
                                                PlayObject.m_DyVal[n14 - 200] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 300 .. 399
                                            case 300:
                                                PlayObject.m_nMval[n14 - 300] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 400 .. 499
                                            case 400:
                                                M2Share.g_Config.GlobaDyMval[n14 - 400] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 500 .. 599
                                            case 500:
                                                PlayObject.m_nInteger[n14 - 500] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            // Modify the A .. B: 800 .. 1199
                                            case 800:// G变量
                                                M2Share.g_Config.GlobalVal[n14 - 700] = HUtil32.Str_ToInt(s4C, 0);
                                                break;
                                            default:
                                                // 1800..2799:begin//20080323 I变量
                                                // g_Config.GlobaDyMval[n14 - 1800]:= Str_ToInt(s4C, 0);
                                                // end;
                                                ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_STRTOINT);
                                                break;
                                        }
                                    }
                                    break;
                                case M2Share.nSC_GUILDMOVE:
                                    if (PlayObject.m_MyGuild == null)
                                    {
                                        return result;
                                    }
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                    PlayObject.MapRandomMove(s4C, 0);
                                    if (PlayObject.m_MyGuild.m_RankList.Count > 0)
                                    {
                                        for (II = 0; II < PlayObject.m_MyGuild.m_RankList.Count; II++)
                                        {
                                            GuildRank = PlayObject.m_MyGuild.m_RankList[II];
                                            if (GuildRank == null)
                                            {
                                                continue;
                                            }
                                            if (GuildRank.MemberList.Count > 0)
                                            {
                                                for (III = 0; III < GuildRank.MemberList.Count; III++)
                                                {
                                                    //UserObject = ((TPlayObject)(GuildRank.MemberList[III]));
                                                    if (UserObject == null)
                                                    {
                                                        continue;
                                                    }
                                                    if ((!UserObject.m_boDeath) && (!UserObject.m_boGhost) && (UserObject.m_boAllowGuildReCall))
                                                    {
                                                        UserObject.MapRandomMove(s4C, 0);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    bo11 = true;
                                    break;
                                case M2Share.nSC_GUILDMAPMOVE:
                                    if (PlayObject.m_MyGuild == null)
                                    {
                                        return result;
                                    }
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref s4C))
                                    {
                                        s4C = QuestActionInfo.sParam1;
                                    }
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref n14))
                                    {
                                        n14 = QuestActionInfo.nParam2;
                                    }
                                    if (!GetValValue(PlayObject, QuestActionInfo.sParam3, ref n40))
                                    {
                                        n40 = QuestActionInfo.nParam3;
                                    }
                                    PlayObject.SendRefMsg(Grobal2.RM_SPACEMOVE_FIRE, 0, 0, 0, 0, "");
                                    PlayObject.SpaceMove(s4C, n14, n40, 0);
                                    if (PlayObject.m_MyGuild.m_RankList.Count > 0)
                                    {
                                        for (II = 0; II < PlayObject.m_MyGuild.m_RankList.Count; II++)
                                        {
                                            GuildRank = PlayObject.m_MyGuild.m_RankList[II];
                                            if (GuildRank == null)
                                            {
                                                continue;
                                            }
                                            if (GuildRank.MemberList.Count > 0)
                                            {
                                                for (III = 0; III < GuildRank.MemberList.Count; III++)
                                                {
                                                    //UserObject = ((TPlayObject)(GuildRank.MemberList[III]));
                                                    if (UserObject == null)
                                                    {
                                                        continue;
                                                    }
                                                    if ((!UserObject.m_boDeath) && (!UserObject.m_boGhost) && (UserObject.m_boAllowGuildReCall))
                                                    {
                                                        UserObject.SpaceMove(s4C, n14, n40, 0);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    bo11 = true;
                                    break;
                                case M2Share.nSC_RANDOMMOVE:
                                    PlayObject.RandomMove();
                                    bo11 = true;
                                    break;
                                case M2Share.nSC_USEBONUSPOINT:
                                    ActionOfUseBonusPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_REPAIRITEM:
                                    ActionOfRepairItem(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAKEONITEM:
                                    ActionOfTakeOnItem(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAKEOFFITEM:// 穿上装备
                                    ActionOfTakeOffItem(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CREATEHERO:// 脱下装备
                                    // =================================英雄相关=====================================
                                    ActionOfCreateHero(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_DELETEHERO:
                                    ActionOfDeleteHero(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROLEVEL:
                                    ActionOfChangeHeroLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROJOB:
                                    ActionOfChangeHeroJob(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLEARHEROSKILL:
                                    ActionOfClearHeroSkill(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROPKPOINT:// 清除英雄技能
                                    ActionOfChangeHeroPKPoint(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROEXP:
                                    ActionOfChangeHeroExp(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENMAKEKIMNEEDLE:
                                    ActionOfOpenMakeKIMNeedle(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAKEKIMNEEDLE:
                                    ActionOfTAKEKIMNEEDLE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_GIVEKIMNEEDLE:
                                    ActionOfGIVEKIMNEEDLE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENPULSE:
                                    ActionOfOPENPULSE(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEPULSELEVEL:
                                    ActionOfChangePulseLevel(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENHEROPULS:
                                    ActionOfOPENHEROPULS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGEHEROPULSEXP:
                                    ActionOfCHANGEHEROPULSEXP(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OPENCATTLEGAS:// 富贵兽命令
                                    ActionOfOPENCATTLEGAS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CLOSECATTLEGAS:
                                    ActionOfCLOSECATTLEGAS(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGECATTLEGASEXP:
                                    ActionOfCHANGECATTLEGASEXP(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_TAKEITMECOUNTDURA:// 给定持久物品命令  这些给定持久命令没有实现
                                    ActionOfTAKEITMECOUNTDURA(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_ASSESSMENTHERO:
                                    // ---------双英雄命令-------------------//
                                    ActionOfASSESSMENTHERO(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_OpenHeroAutoPractice:
                                    ActionOfOpenHeroAutoPractice(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_StopHeroAutoPractice:
                                    ActionOfStopHeroAutoPractice(PlayObject, QuestActionInfo);
                                    break;
                                case M2Share.nSC_CHANGETRANPOINT:
                                    // ----------------------------------------//
                                    ActionOfCHANGETRANPOINT(PlayObject, QuestActionInfo);
                                    break;
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} QuestActionProcess CMDCode:" + (CMDCode).ToString());
            }
            return result;
        }

        /// <summary>
        /// 发送NPC对话框内容
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sMsg"></param>
        /// <param name="boFlag"></param>
        public void SendMerChantSayMsg(TPlayObject PlayObject, string sMsg, bool boFlag)
        {
            string s10 = string.Empty;
            string s14 = s14 = sMsg;
            int nC = 0;
            while (true)
            {
                if (HUtil32.TagCount(s14, '>') < 1)
                {
                    break;
                }
                s14 = HUtil32.ArrestStringEx(s14, "<", ">", ref s10);
                GetVariableText(PlayObject, ref sMsg, s10);
                nC++;
                if (nC >= 101)
                {
                    break;
                }
            }
            PlayObject.GetScriptLabel(sMsg);
            if (boFlag)
            {
                PlayObject.SendFirstMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/" + sMsg);
            }
            else
            {
                PlayObject.SendMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/" + sMsg);
            }
        }

        /// <summary>
        /// 跳转到脚本标签
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sLabel"></param>
        /// <param name="boExtJmp"></param>
        public unsafe void GotoLable(TPlayObject PlayObject, string sLabel, bool boExtJmp)
        {
            TStringList List1C = null;
            bool bo11;
            int n20;
            string sSENDMSG;
            TScript Script;
            TUserItem* UserItem = null;
            byte nCode;
            m_boGotoCount++;
            if (m_boGotoCount > 850)// 防止M2不断进入GoTo而关闭
            {
                m_boGotoCount = 0;
                M2Share.MainOutMessage("[脚本异常] NPC:" + this.m_sCharName + " 位置:" + this.m_sMapName + "(" + this.m_nCurrX + ":" + this.m_nCurrY + ")");
                return;
            }
            try
            {
                Script = null;
                List1C = new TStringList();
                n20 = 0;
                nCode = 0;
                try
                {
                    if (PlayObject.m_NPC != this)
                    {
                        nCode = 1;
                        PlayObject.m_NPC = null;
                        PlayObject.m_Script = null;
                        for (int i = 0; i < PlayObject.m_nVal.Length; i++)
                        {
                            PlayObject.m_nVal[i] = 0;
                        }
                    }
                    if (string.Compare(sLabel, "@main", true) == 0)
                    {
                        if (m_ScriptList.Count > 0)
                        {
                            nCode = 2;
                            foreach (var Script3C in m_ScriptList)
                            {
                                if (Script3C == null)
                                {
                                    continue;
                                }
                                if (Script3C.RecordList.Count > 0)
                                {
                                    foreach (var SayingRecord in Script3C.RecordList)
                                    {
                                        if (SayingRecord == null)
                                        {
                                            continue;
                                        }
                                        if (string.Compare(sLabel, SayingRecord.sLabel, true) == 0)
                                        {
                                            nCode = 3;
                                            Script = Script3C;
                                            PlayObject.m_Script = Script;
                                            PlayObject.m_NPC = this;
                                            break;
                                        }
                                        if (Script != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    nCode = 4;
                    if (Script == null)
                    {
                        if (PlayObject.m_Script != null)
                        {
                            if (m_ScriptList.Count > 0)
                            {
                                for (int I = m_ScriptList.Count - 1; I >= 0; I--)
                                {
                                    if (m_ScriptList.Count <= 0)
                                    {
                                        break;
                                    }
                                    if ((m_ScriptList[I] != null) && (m_ScriptList[I] == PlayObject.m_Script))
                                    {
                                        Script = m_ScriptList[I];
                                        if (Script != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                        nCode = 5;
                        if (Script == null)
                        {
                            if (m_ScriptList.Count > 0)
                            {
                                for (int I = m_ScriptList.Count - 1; I >= 0; I--)
                                {
                                    if (m_ScriptList.Count <= 0)
                                    {
                                        break;
                                    }
                                    if ((m_ScriptList[I] != null) && GotoLable_CheckQuestStatus(PlayObject, m_ScriptList[I]))
                                    {
                                        Script = m_ScriptList[I];
                                        PlayObject.m_Script = Script;
                                        PlayObject.m_NPC = this;
                                        if (Script != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    nCode = 6;
                    if (Script != null)// 跳转到指定示签，执行
                    {
                        if (Script.RecordList.Count > 0)
                        {
                            foreach (var SayingRecord in Script.RecordList)
                            {
                                if (SayingRecord == null)
                                {
                                    continue;
                                }
                                if (string.Compare(sLabel, SayingRecord.sLabel, true) == 0)
                                {
                                    if (boExtJmp && !SayingRecord.boExtJmp)
                                    {
                                        break;
                                    }
                                    sSENDMSG = "";
                                    if (SayingRecord.ProcedureList.Count > 0)
                                    {
                                        foreach (var SayingProcedure in SayingRecord.ProcedureList)
                                        {
                                            if (SayingProcedure == null)
                                            {
                                                continue;
                                            }
                                            bo11 = false;
                                            nCode = 7;
                                            if (QuestCheckCondition(PlayObject, UserItem, SayingProcedure.ConditionList))
                                            {
                                                sSENDMSG = sSENDMSG + SayingProcedure.sSayMsg;
                                                nCode = 8;
                                                if (!QuestActionProcess(PlayObject, UserItem, SayingProcedure.ActionList))
                                                {
                                                    break;
                                                }
                                                nCode = 9;
                                                if (bo11)
                                                {
                                                    SendMerChantSayMsg(PlayObject, sSENDMSG, true);
                                                }
                                            }
                                            else
                                            {
                                                sSENDMSG = sSENDMSG + SayingProcedure.sElseSayMsg;
                                                nCode = 10;
                                                if (!QuestActionProcess(PlayObject, UserItem, SayingProcedure.ElseActionList))
                                                {
                                                    break;
                                                }
                                                nCode = 11;
                                                if (bo11)
                                                {
                                                    SendMerChantSayMsg(PlayObject, sSENDMSG, true);
                                                }
                                            }  
                                        }
                                    }
                                    nCode = 12;
                                    if (sSENDMSG != "")
                                    {
                                        SendMerChantSayMsg(PlayObject, sSENDMSG, false);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                catch
                {
                    M2Share.MainOutMessage("{异常} TNormNpc.GotoLable Code:" + nCode);
                }
            }
            finally
            {
                m_boGotoCount = 0;
                Dispose(List1C);
            }
        }

        /// <summary>
        /// 读取NPC脚本
        /// </summary>
        public void LoadNpcScript()
        {
            string s08;
            if (m_boIsQuest)
            {
                m_sPath = M2Share.sNpc_def;
                s08 = this.m_sCharName + "-" + this.m_sMapName;
                LocalDB.GetInstance().LoadNpcScript(this, m_sFilePath, s08);
            }
            else
            {
                m_sPath = m_sFilePath;
                LocalDB.GetInstance().LoadNpcScript(this, m_sFilePath, this.m_sCharName);
            }
        }

        public  override bool Operate(TProcessMessage ProcessMsg)
        {
            return base.Operate(ProcessMsg);
        }

        public override void Run()
        {
            int nInteger;
            byte nCode = 0;
            try
            {
                nCode = 0;
                if (this.m_Master != null) // 不允许召唤为宝宝
                {
                    this.m_Master = null;
                }
                nCode = 1;// NPC变色
                if (m_boNpcAutoChangeColor && (m_dwNpcAutoChangeColorTime > 0) && (HUtil32.GetTickCount() - m_dwNpcAutoChangeColorTick > m_dwNpcAutoChangeColorTime))
                {
                    nCode = 2;
                    m_dwNpcAutoChangeColorTick = HUtil32.GetTickCount();
                    switch (m_nNpcAutoChangeIdx)
                    {
                        case 0:
                            nInteger = Grobal2.STATE_TRANSPARENT;
                            break;
                        case 1:// 8
                            nInteger = Grobal2.POISON_STONE;
                            break;
                        case 2:// 5
                            nInteger = Grobal2.POISON_DONTMOVE;
                            break;
                        case 3:// 4
                            nInteger = Grobal2.POISON_68;
                            break;
                        case 4:// 68
                            nInteger = Grobal2.POISON_DECHEALTH;
                            break;
                        case 5:// 0
                            nInteger = Grobal2.POISON_LOCKSPELL;
                            break;
                        case 6:// 2
                            nInteger = Grobal2.POISON_DAMAGEARMOR;
                            break;
                        default:// 1
                            m_nNpcAutoChangeIdx = 0;
                            nInteger = Grobal2.STATE_TRANSPARENT;
                            break;
                    }
                    nCode = 3;
                    m_nNpcAutoChangeIdx++;
                    this.m_nCharStatus = Convert.ToInt32((this.m_nCharStatusEx & 0xFFFFF) | ((0x80000000 >> nInteger) | 0));
                    nCode = 4;
                    this.StatusChanged("");
                }
                nCode = 5;
                if (this.m_boFixColor && (this.m_nFixStatus != this.m_nCharStatus))
                {
                    nCode = 6;
                    switch (this.m_nFixColorIdx)
                    {
                        case 0:
                            nInteger = Grobal2.STATE_TRANSPARENT;
                            break;
                        case 1:
                            nInteger = Grobal2.POISON_STONE;
                            break;
                        case 2:
                            nInteger = Grobal2.POISON_DONTMOVE;
                            break;
                        case 3:
                            nInteger = Grobal2.POISON_68;
                            break;
                        case 4:
                            nInteger = Grobal2.POISON_DECHEALTH;
                            break;
                        case 5:
                            nInteger = Grobal2.POISON_LOCKSPELL;
                            break;
                        case 6:
                            nInteger = Grobal2.POISON_DAMAGEARMOR;
                            break;
                        default:
                            this.m_nFixColorIdx = 0;
                            nInteger = Grobal2.STATE_TRANSPARENT;
                            break;
                    }
                    nCode = 7;
                    this.m_nCharStatus = Convert.ToInt32((this.m_nCharStatusEx & 0xFFFFF) | ((0x80000000 >> nInteger) | 0));
                    this.m_nFixStatus = this.m_nCharStatus;
                    nCode = 8;
                    this.StatusChanged("");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.Run Code:" + nCode);
            }
            base.Run();
        }

        /// <summary>
        /// 脚本错误提示
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sErrMsg"></param>
        /// <param name="QuestActionInfo"></param>
        /// <param name="sCmd"></param>
        private void ScriptActionError(TPlayObject PlayObject, string sErrMsg, TQuestActionInfo QuestActionInfo, string sCmd)
        {
            const string sOutMessage = "[脚本错误] {0} 脚本命令:{1} NPC名称:{2} 地图:{3}({4}:{5}) 参数1:{6} 参数2:{7} 参数3:{8} 参数4:{9} 参数5:{10} 参数6:{11} 玩家:{12}";
            string sMsg = string.Format(sOutMessage, sErrMsg, sCmd, this.m_sCharName, this.m_sMapName, this.m_nCurrX, this.m_nCurrY, QuestActionInfo.sParam1,
                QuestActionInfo.sParam2, QuestActionInfo.sParam3, QuestActionInfo.sParam4, QuestActionInfo.sParam5, QuestActionInfo.sParam6, PlayObject.m_sCharName);
            M2Share.MainOutMessage(sMsg);
        }

        private void ScriptConditionError(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo, string sCmd)
        {
            string sMsg;
            sMsg = "Cmd:" + sCmd + " NPC名称:" + this.m_sCharName + " 地图:" + this.m_sMapName + " 座标:" + (this.m_nCurrX).ToString() + ":"
                + (this.m_nCurrY).ToString() + " 参数1:" + QuestConditionInfo.sParam1 + " 参数2:" + QuestConditionInfo.sParam2 + " 参数3:" + QuestConditionInfo.sParam3 
                + " 参数4:" + QuestConditionInfo.sParam4 + " 参数5:" + QuestConditionInfo.sParam5;
            M2Share.MainOutMessage("[脚本参数不正确] " + sMsg);
        }

        public void SendMsgToUser(TPlayObject PlayObject, string sMsg)
        {
            PlayObject.SendMsg(this, Grobal2.RM_MERCHANTSAY, 0, 0, 0, 0, this.m_sCharName + "/" + sMsg);
        }

        public string sub_49ADB8(string sMsg, string sStr, string sText)
        {
            string result;
            int n10;
            string s14;
            string s18;
            n10 = sMsg.IndexOf(sStr);
            if (n10 > -1)
            {
                s14 = sMsg.Substring(1 - 1, n10);
                s18 = sMsg.Substring(sStr.Length + n10, sMsg.Length - (sStr.Length + n10));
                result = s14 + sText + s18;
            }
            else
            {
                result = sMsg;
            }
            return result;
        }

        /// <summary>
        /// 玩家点击脚本标签
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sData"></param>
        public virtual void UserSelect(TPlayObject PlayObject, string sData)
        {
            string sMsg;
            string sLabel = string.Empty;
            try
            {
                PlayObject.m_nScriptGotoCount = 0;
                // 处理脚本命令 @back 返回上级标签内容
                if ((sData != "") && (sData[0] == '@'))
                {
                    sMsg = HUtil32.GetValidStr3(sData, ref sLabel, new string[] { "\r" });
                    if (sLabel == "@goHero1")// 支持卧龙笔记移动
                    {
                        GotoLable(PlayObject, sLabel, false);
                    }
                    else
                    {
                        if ((PlayObject.m_sScriptCurrLable != sLabel))
                        {
                            if ((sLabel != M2Share.sBACK))
                            {
                                PlayObject.m_sScriptGoBackLable = PlayObject.m_sScriptCurrLable;
                                PlayObject.m_sScriptCurrLable = sLabel;
                            }
                            else
                            {
                                if (PlayObject.m_sScriptCurrLable != "")
                                {
                                    PlayObject.m_sScriptCurrLable = "";
                                }
                                else
                                {
                                    PlayObject.m_sScriptGoBackLable = "";
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.UserSelect");
            }
        }

        /// <summary>
        /// 改变名字颜色
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeNameColor(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nColor = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref nColor))// 增加变量支持
                {
                    nColor = QuestActionInfo.nParam1;
                }
                if ((nColor < 0) || (nColor > 255))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGENAMECOLOR);
                    return;
                }
                PlayObject.m_btNameColor = (byte)nColor;
                PlayObject.RefNameColor();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeNameColor");
            }
        }

        /// <summary>
        /// 清除仓库密码
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfClearPassword(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_sStoragePwd = "";
                PlayObject.m_boPasswordLocked = false;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearPassword");
            }
        }

        /// <summary>
        /// RECALLMOB 怪物名称 等级 叛变时间 变色(0,1) 固定颜色(1-7) 是否显示主人名字(1--不显示,空或其它值显示)
        /// 变色为0 时固定颜色才起作用
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfRecallmob(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject mon;
            int nParam3;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nParam3 = HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0);
                if (nParam3 <= 1)
                {
                    mon = PlayObject.MakeSlave(QuestActionInfo.sParam1, 3, HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0), 100, 864000); // 10 * 24 * 60 * 60
                }
                else
                {
                    mon = PlayObject.MakeSlave(QuestActionInfo.sParam1, 3, HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0), 100, Convert.ToUInt32(nParam3 * 60));
                }
                if (mon != null)
                {
                    if ((QuestActionInfo.sParam4 != "") && (QuestActionInfo.sParam4[1] == '1'))
                    {
                        mon.m_boAutoChangeColor = true;
                    }
                    else if (QuestActionInfo.nParam5 > 0)
                    {
                        mon.m_boFixColor = true;
                        mon.m_nFixColorIdx = QuestActionInfo.nParam5 - 1;
                    }
                    if ((QuestActionInfo.sParam6 != "") && (QuestActionInfo.sParam6[1] == '1'))
                    {
                        mon.m_nCopyHumanLevel = 3; // 不显示主人名字
                    }
                    if (mon.m_btRaceServer == Grobal2.RC_PLAYMOSTER) // 如果是人形怪
                    {
                        mon.m_nCopyHumanLevel = 1;
                        if ((QuestActionInfo.sParam6 != "") && (QuestActionInfo.sParam6[1] == '1'))
                        {
                            mon.m_nCopyHumanLevel = 3;// 不显示主人名字
                        }
                        if (this.m_ItemList.Count > 0)
                        {
                            for (int I = 0; I < this.m_ItemList.Count; I++) // 清除包裹
                            {
                                Dispose(this.m_ItemList[I]);
                            }
                        }
                        this.m_ItemList.Clear();
                        ((TPlayMonster)(mon)).InitializeMonster();// 人形怪重新加载怪物设置
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRecallmob");
            }
        }

        /// <summary>
        /// RECALLMOBEX 怪物名称 名称颜色 坐标X 坐标Y
        /// 注，使用该命令召出的宝宝，凡是没有主人或者与主人不在同一地图将自动消失
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfRecallMobex(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject mon;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                mon = UserEngine.RegenMonsterByName(this.m_PEnvir.sMapName, HUtil32.Str_ToInt(QuestActionInfo.sParam3, 0), 
                    HUtil32.Str_ToInt(QuestActionInfo.sParam4, 0), QuestActionInfo.sParam1);
                if (mon != null)
                {
                    mon.m_Master = PlayObject;
                    mon.m_dwMasterRoyaltyTick = 86400000; // 24 * 60 * 60 * 1000
                    mon.m_dwMasterRoyaltyTime = HUtil32.GetTickCount();// 怪物叛变计时
                    mon.m_btSlaveMakeLevel = 3;
                    mon.m_btSlaveExpLevel = 1;
                    if (mon.m_btRaceServer == 135)// 135怪,不显示主人名字
                    {
                        mon.m_nCopyHumanLevel = 3;
                        mon.m_btSlaveExpLevel = M2Share.SLAVEMAXLEVEL;// 135怪,不改变名字颜色
                    }
                    mon.m_btNameColor = (byte)HUtil32.Str_ToInt(QuestActionInfo.sParam2, 0);
                    mon.RecalcAbilitys();
                    mon.RefNameColor();
                    PlayObject.m_SlaveList.Add(mon);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRECALLMOBEX");
            }
        }
            
        /// <summary>
        /// 命令格式:MOVEMOBTO 怪物名称 原地图 原X 原Y 新地图 新X 新Y 
        /// (将指定坐标的怪物移动到新坐标，名称为ALL则移动该坐标所有怪)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMoveMobto(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            bool boMoveAll;
            string sMonName;
            string sMap1;
            string sMap2;
            TEnvirnoment SrcEnvir;
            TEnvirnoment DenEnvir;
            List<TBaseObject> MonList;
            int nX;
            int nY;
            int OnX;
            int OnY;
            TBaseObject MoveMon;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                boMoveAll = false;
                nX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam6), -1);// 新X 支持变量
                nY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam7), -1);// 新Y 支持变量
                OnX = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);// 原X 支持变
                OnY = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam4), -1);// 原Y 支持变
                sMonName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);// 怪物名称 支持变量 
                if (sMonName == "ALL")
                {
                    boMoveAll = true;
                }
                sMap1 = GetLineVariableText(PlayObject, QuestActionInfo.sParam2);// 地图支持变量
                sMap2 = GetLineVariableText(PlayObject, QuestActionInfo.sParam5);// 地图支持变量
                SrcEnvir = M2Share.g_MapManager.FindMap(sMap1);
                DenEnvir = M2Share.g_MapManager.FindMap(sMap2);
                if ((SrcEnvir == null) || (DenEnvir == null))
                {
                    return;
                }
                MonList = new List<TBaseObject>();
                try
                {
                    if (!boMoveAll) // 指定名称的怪移动
                    {
                        UserEngine.GetMapRangeMonster(SrcEnvir, OnX, OnY, 1, MonList);// 查指定XY范围内的怪
                        if (MonList.Count > 0)
                        {
                            for (int I = 0; I < MonList.Count; I++)
                            {
                                MoveMon = MonList[I];
                                if (MoveMon != this)
                                {
                                    if (string.Compare(MoveMon.m_sCharName, sMonName, true) == 0) // 是否是指定名称的怪
                                    {
                                        MoveMon.SpaceMove(sMap2, nX, nY, 0);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        // 所有怪移动
                        UserEngine.GetMapRangeMonster(SrcEnvir, OnX, OnY, 1000, MonList);// 查指定XY范围内的怪
                        if (MonList.Count > 0)
                        {
                            for (int I = 0; I < MonList.Count; I++)
                            {
                                MoveMon = MonList[I];
                                if (MoveMon != this)
                                {
                                    MoveMon.SpaceMove(sMap2, nX, nY, 0);
                                }
                            }
                        }
                    }
                }
                finally
                {
                    Dispose(MonList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMOVEMOBTO");
            }
        }

        /// <summary>
        /// ClearItemMap 地图 X Y 范围 物品名称 
        /// (清除地图物品，物品名称为ALL则清除所有)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfClearItemMap(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sItmeName;
            string sMap;
            int nX;
            int nY;
            int nRange;
            int nXX;
            int nYY;
            bool boClearAll;
            TEnvirnoment Envir;
            TMapItem MapItem;
            List<TMapItem> ItemList;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                boClearAll = false;
                sItmeName = QuestActionInfo.sParam5;// 物品名称
                sMap = QuestActionInfo.sParam1;
                if ((sMap != "") && (sMap[0] == '<') && (sMap[1] == '$')) // 增加支持<$Str()>
                {
                    sMap = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                }
                else
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref sMap);
                }
                nX = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);// X
                nY = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);// Y
                nRange = HUtil32.Str_ToInt(QuestActionInfo.sParam4, -1);// 范围
                if ((sItmeName == "ALL") || (sItmeName == ""))
                {
                    boClearAll = true;
                }
                Envir = M2Share.g_MapManager.FindMap(sMap);// 查找地图
                if (Envir != null)
                {
                    ItemList = new List<TMapItem>();
                    Envir.GetMapItem(nX, nY, nRange, ItemList);// 取地图上指定范围的物品
                    if (!boClearAll)  // 清除指定物品
                    {
                        if (ItemList.Count > 0)
                        {
                            for (int I = 0; I < ItemList.Count; I++)
                            {
                                MapItem = ItemList[I];
                                if (((MapItem.Name).ToLower().CompareTo((sItmeName).ToLower()) == 0))
                                {
                                    for (nXX = nX - nRange; nXX <= nX + nRange; nXX++)
                                    {
                                        for (nYY = nY - nRange; nYY <= nY + nRange; nYY++)
                                        {
                                            Envir.DeleteFromMap(nXX, nYY, Grobal2.OS_ITEMOBJECT, MapItem);
                                            if (MapItem == null)
                                            {
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        // 清除全部物品
                        if (ItemList.Count > 0)
                        {
                            for (int I = 0; I < ItemList.Count; I++)
                            {
                                MapItem = ItemList[I];
                                for (nXX = nX - nRange; nXX <= nX + nRange; nXX++)
                                {
                                    for (nYY = nY - nRange; nYY <= nY + nRange; nYY++)
                                    {
                                        Envir.DeleteFromMap(nXX, nYY, Grobal2.OS_ITEMOBJECT, MapItem);
                                        if (MapItem == null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    Dispose(ItemList);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCLEARITEMMAP");
            }
        }

        private void ActionOfReNewLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nReLevel;
            int nLevel;
            int nBounsuPoint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nReLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                nBounsuPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                if (nReLevel < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nReLevel);// 增加变量支持
                }
                if (nLevel < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLevel);// 增加变量支持
                }
                if (nBounsuPoint < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam3, ref nBounsuPoint);// 增加变量支持
                }
                if ((nReLevel < 0) || (nLevel < 0) || (nBounsuPoint < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_RENEWLEVEL);
                    return;
                }
                if ((PlayObject.m_btReLevel + nReLevel) <= 255)
                {
                    PlayObject.m_btReLevel += (byte)nReLevel;
                    if (nLevel > 0)
                    {
                        PlayObject.m_Abil.Level = (ushort)nLevel;
                        // 等级调整记录日志
                        M2Share.AddGameDataLog("17" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09"
                            + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + (PlayObject.m_Abil.Level).ToString()
                            + "\09" + "0" + "\09" + "=(" + (nLevel).ToString() + ")" + "\09" + this.m_sCharName + "(转生)");
                    }
                    if (M2Share.g_Config.boReNewLevelClearExp)
                    {
                        PlayObject.m_Abil.Exp = 0;
                    }
                    PlayObject.m_nBonusPoint += nBounsuPoint;
                    PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                    PlayObject.HasLevelUp(0);
                    PlayObject.RefShowName();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfReNewLevel");
            }
        }

        /// <summary>
        /// 功能：改变角色性别
        /// 格式：CHANGEGENDER 性别(0,1) Hero
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeGender(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nGENDER;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nGENDER = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                if (!(new ArrayList(new int[] { 0, 1 }).Contains(nGENDER)))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGENDER);
                    return;
                }
                if ((QuestActionInfo.sParam2).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEGENDER);
                        return;
                    }
                    if (PlayObject.m_MyHero != null)
                    {
                        PlayObject.m_MyHero.m_btGender = (byte)nGENDER;
                        ((THeroObject)(PlayObject.m_MyHero)).SendMsg(PlayObject.m_MyHero, Grobal2.RM_HEROABILITY, 0, 0, 0, 0, "");// 发送英雄属性
                        PlayObject.m_MyHero.FeatureChanged();
                    }
                }
                else
                {
                    PlayObject.m_btGender = (byte)nGENDER;
                    PlayObject.FeatureChanged();
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeGender");
            }
        }

        /// <summary>
        /// 清除属下
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfKillSlave(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject Slave;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_SlaveList.Count > 0)
                {
                    for (int I = 0; I < PlayObject.m_SlaveList.Count; I++)
                    {
                        Slave = PlayObject.m_SlaveList[I];
                        Slave.m_WAbil.HP = 0;
                        Slave.MakeGhost();
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKillSlave");
            }
        }

        /// <summary>
        /// 改变经验倍数
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfKillMonExpRate(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nRate;
            int nTime;
            byte nCode = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject != null)
                {
                    nRate = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                    nTime = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                    if ((nRate < 0) || (nTime < 0))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_KILLMONEXPRATE);
                        return;
                    }
                    nCode = 1;
                    PlayObject.m_nKillMonExpRate = nRate;
                    PlayObject.m_nOldKillMonExpRate = PlayObject.m_nKillMonExpRate;
                    PlayObject.m_dwKillMonExpRateTime = (UInt16)nTime;
                    nCode = 2;
                    if (PlayObject.m_MyHero != null)  // 英雄也同时双倍经验 
                    {
                        nCode = 3;
                        ((THeroObject)(PlayObject.m_MyHero)).m_nKillMonExpRate = nRate;
                        ((THeroObject)(PlayObject.m_MyHero)).m_nOldKillMonExpRate = ((THeroObject)(PlayObject.m_MyHero)).m_nKillMonExpRate;// 没使用套装前杀怪经验倍数
                    }
                    nCode = 4;
                    if (M2Share.g_Config.boShowScriptActionMsg)
                    {
                        nCode = 5;
                        PlayObject.SysMsg(string.Format(GameMsgDef.g_sChangeKillMonExpRateMsg, PlayObject.m_nKillMonExpRate / 100, PlayObject.m_dwKillMonExpRateTime), TMsgColor.c_Green, TMsgType.t_Hint);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKillMonExpRate Code:" + nCode);
            }
        }

        /// <summary>
        /// 格式:MONGENEX 地图 X Y 怪名|是否内功怪(0/1)|怪物颜色值 范围 数量
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfMonGenEx(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sMapName;
            string sMonName = string.Empty;
            string sNGMon;
            string sNameColor;
            int nMapX = 0;
            int nMapY = 0;
            int nRange = 0;
            int nCount = 0;
            int nRandX = 0;
            int nRandY = 0;
            byte nNameColor = 0;
            TBaseObject Monster;
            string sStr;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sNGMon = "";
                sNameColor = "";
                sMapName = QuestActionInfo.sParam1;
                nMapX = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                nMapY = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);
                if (QuestActionInfo.sParam4.IndexOf("|") > 0)
                {
                    sStr = HUtil32.GetValidStr3(QuestActionInfo.sParam4, ref sMonName, new string[] { "|" });
                    sNameColor = HUtil32.GetValidStr3(sStr, ref sNGMon, new string[] { "|" });
                    if ((sNameColor != ""))
                    {
                        nNameColor = (byte)HUtil32.Str_ToInt(sNameColor.Trim(), 255); // 名字颜色
                    }
                }
                else
                {
                    sMonName = QuestActionInfo.sParam4;
                }
                nRange = QuestActionInfo.nParam5;
                nCount = QuestActionInfo.nParam6;
                if ((sMapName == "") || (nMapX <= 0) || (nMapY <= 0) || (sMapName == "") || (nRange <= 0) || (nCount <= 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_MONGENEX);
                    return;
                }
                for (int I = 0; I < nCount; I++)
                {
                    nRandX = HUtil32.Random(nRange * 2 + 1) + (nMapX - nRange);
                    nRandY = HUtil32.Random(nRange * 2 + 1) + (nMapY - nRange);
                    Monster = UserEngine.RegenMonsterByName(sMapName, nRandX, nRandY, sMonName);
                    if (Monster == null)
                    {
                        //ScriptActionError(PlayObject,"",QuestActionInfo,sSC_MONGENEX);
                        break;
                    }
                    else
                    {
                        if ((sNGMon != ""))
                        {
                            Monster.m_boIsNGMonster = sNGMon != "0";
                        }
                        if ((sNameColor != ""))
                        {
                            Monster.m_btNameColor = nNameColor;
                            Monster.m_boSetNameColor = true;
                            Monster.RefNameColor();
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfMonGenEx");
            }
        }

        private void ActionOfOpenMagicBox(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TBaseObject Monster;
            string sMonName;
            int nX = 0;
            int nY = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMonName = QuestActionInfo.sParam1;
                if (sMonName == "")
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_OPENMAGICBOX);
                    return;
                }
                PlayObject.GetFrontPosition(ref nX, ref nY);
                Monster = UserEngine.RegenMonsterByName(PlayObject.m_PEnvir.sMapName, nX, nY, sMonName);
                if (Monster == null)
                {
                    return;
                }
                Monster.Die();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfOpenMagicBox");
            }
        }

        private void ActionOfPkZone(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nX;
            int nY;
            TFireBurnEvent FireBurnEvent;
            int nMinX;
            int nMaxX;
            int nMinY;
            int nMaxY;
            int nRange;
            int nType;
            int nTime;
            int nPoint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nRange = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                nType = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                nTime = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);
                nPoint = HUtil32.Str_ToInt(QuestActionInfo.sParam4, -1);
                if ((nRange < 0) || (nType < 0) || (nTime < 0) || (nPoint < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_PKZONE);
                    return;
                }
                nMinX = this.m_nCurrX - nRange;
                nMaxX = this.m_nCurrX + nRange;
                nMinY = this.m_nCurrY - nRange;
                nMaxY = this.m_nCurrY + nRange;
                for (nX = nMinX; nX <= nMaxX; nX++)
                {
                    for (nY = nMinY; nY <= nMaxY; nY++)
                    {
                        if (((nX < nMaxX) && (nY == nMinY)) || ((nY < nMaxY) && (nX == nMinX)) || (nX == nMaxX) || (nY == nMaxY))
                        {
                            FireBurnEvent = new TFireBurnEvent(PlayObject, nX, nY, nType, Convert.ToUInt32(nTime * 1000), nPoint);
                            M2Share.g_EventManager.AddEvent(FireBurnEvent);
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfPkZone");
            }
        }

        /// <summary>
        /// 功能:设置攻击力倍数
        /// 格式:POWERRATE 倍率 有效时间
        /// 说明:倍率 为杀攻击力倍数，倍数除以100为真正的倍率(200 为 2 倍经验，150 为1.5倍)
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfPowerRate(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nRate;
            int nTime;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nRate = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                nTime = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                if ((nRate < 0) || (nTime < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_POWERRATE);
                    return;
                }
                PlayObject.m_nPowerRate = nRate;
                PlayObject.m_dwPowerRateTime = (uint)nTime;
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    // PlayObject.SysMsg(string.Format(GameMsgDef.g_sChangePowerRateMsg, new uint[] {PlayObject.m_nPowerRate / 100, PlayObject.m_dwPowerRateTime}), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfPowerRate");
            }
        }

        /// <summary>
        /// 改变特殊管理模式
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangeMode(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMode;
            bool boOpen;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMode = QuestActionInfo.nParam1;
                boOpen = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1) == 1;
                if (nMode >= 1 && nMode <= 3)
                {
                    switch (nMode)
                    {
                        case 1:// 管理模式
                            PlayObject.m_boAdminMode = boOpen;
                            if (PlayObject.m_boAdminMode)
                            {
                                PlayObject.SysMsg(GameMsgDef.sGameMasterMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            else
                            {
                                PlayObject.SysMsg(GameMsgDef.sReleaseGameMasterMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            break;
                        case 2:// 无敌模式
                            PlayObject.m_boSuperMan = boOpen;
                            if (PlayObject.m_boSuperMan)
                            {
                                PlayObject.SysMsg(GameMsgDef.sSupermanMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            else
                            {
                                PlayObject.SysMsg(GameMsgDef.sReleaseSupermanMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            break;
                        case 3:// 隐身模式
                            PlayObject.m_boObMode = boOpen;
                            if (PlayObject.m_boObMode)
                            {
                                PlayObject.SysMsg(GameMsgDef.sObserverMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            else
                            {
                                PlayObject.SysMsg(GameMsgDef.g_sReleaseObserverMode, TMsgColor.c_Green, TMsgType.t_Hint);
                            }
                            break;
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEMODE);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangeMode");
            }
        }

        /// <summary>
        /// 改变管理模式
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfChangePerMission(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nPermission;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nPermission = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                if (nPermission >= 0 && nPermission <= 10)
                {
                    PlayObject.m_btPermission = (byte)nPermission;
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CHANGEPERMISSION);
                    return;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sChangePermissionMsg, PlayObject.m_btPermission), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfChangePerMission");
            }
        }

        /// <summary>
        /// 给物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfGiveItem(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            string sItemName;
            int nItemCount;
            bool boHero;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItemName = GetLineVariableText(PlayObject, QuestActionInfo.sParam1);
                if (sItemName == "")
                {
                    sItemName = QuestActionInfo.sParam1;
                }
                nItemCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);// 属性 支持变量
                if (nItemCount < 0)
                {
                    nItemCount = QuestActionInfo.nParam2;
                }
                if ((sItemName == "") || (nItemCount <= 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GIVE);
                    return;
                }
                if (nItemCount <= 0)
                {
                    return;
                }
                if ((sItemName).ToLower().CompareTo((M2Share.sSTRING_GOLDNAME).ToLower()) == 0)
                {
                    PlayObject.IncGold(nItemCount);
                    PlayObject.GoldChanged();
                    if (M2Share.g_boGameLogGold)
                    {
                        M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" 
                            + PlayObject.m_sCharName + "\09" + M2Share.sSTRING_GOLDNAME + "\09" + (nItemCount).ToString() + "\09" + "1" + "\09" + this.m_sCharName);
                    }
                    return;
                }
                boHero = false;
                if ((QuestActionInfo.sParam3).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (PlayObject.m_MyHero != null)
                    {
                        boHero = true;
                    }
                }
                if (UserEngine.GetStdItemIdx(sItemName) > 0)
                {
                    if ((nItemCount <= 0) || (nItemCount > 50))
                    {
                        nItemCount = 1;// nItemCount 为0时出死循环
                    }
                    for (int I = 0; I < nItemCount; I++) 
                    {
                        if (boHero)
                        {
                            if (((THeroObject)(PlayObject.m_MyHero)).IsEnoughBag())
                            {
                                UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                {
                                    PlayObject.m_MyHero.m_ItemList.Add((IntPtr)UserItem);
                                    ((THeroObject)(PlayObject.m_MyHero)).SendAddItem(UserItem);
                                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                    if (StdItem->NeedIdentify == 1)
                                    {
                                        M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09"
                                            + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_MyHero.m_sCharName + "\09" + sItemName + "\09"
                                            + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() + "/" + (HUtil32.HiWord(StdItem->DC)).ToString() + ")"
                                            + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/"
                                            + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() + "/" + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "("
                                            + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")" + (UserItem->btValue[0]).ToString() + "/" +
                                            (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString() + "/" +
                                            (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() + "/" + (UserItem->btValue[6]).ToString() + "/" +
                                            (UserItem->btValue[7]).ToString() + "/" + (UserItem->btValue[8]).ToString() + "/" + (UserItem->btValue[14]).ToString() + "\09"
                                            + this.m_sCharName);
                                    }
                                }
                                else
                                {
                                    Marshal.FreeHGlobal((IntPtr)UserItem);
                                }
                            }
                            else
                            {
                                boHero = false;
                                if (PlayObject.IsEnoughBag())// 包裹没位则给主人
                                {
                                    UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                    if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                    {
                                        PlayObject.m_ItemList.Add((IntPtr)UserItem);
                                        PlayObject.SendAddItem(UserItem);
                                        StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                        if (StdItem->NeedIdentify == 1)
                                        {
                                            M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" +
                                                (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + sItemName + "\09" + (UserItem->MakeIndex).ToString()
                                                + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() + "/" + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/"
                                                + (HUtil32.HiWord(StdItem->MC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" 
                                                + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() + "/" + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() 
                                                + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")" + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" +
                                                (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString() + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() 
                                                + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString() + "/" + (UserItem->btValue[8]).ToString() + "/" + (UserItem->btValue[14]).ToString() 
                                                + "\09" + this.m_sCharName);
                                        }
                                    }
                                    else
                                    {
                                        Marshal.FreeHGlobal((IntPtr)UserItem);
                                    }
                                }
                                else
                                {
                                    UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                    if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                    {
                                        StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                        if (StdItem->NeedIdentify == 1)
                                        {
                                            M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString() + "\09" 
                                                + PlayObject.m_sCharName + "\09" + sItemName + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() + "/" 
                                                + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")" 
                                                + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() 
                                                + "/" + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() 
                                                + ")" + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString() 
                                                + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString()
                                                + "/" + (UserItem->btValue[8]).ToString() + "/" + (UserItem->btValue[14]).ToString() + "\09" + this.m_sCharName);
                                        }
                                        PlayObject.DropItemDown(UserItem, 3, false, false, PlayObject, PlayObject);
                                    }
                                    else
                                    {
                                        Marshal.FreeHGlobal((IntPtr)UserItem);
                                    }
                                }
                            }
                        }
                        else
                        {
                            if (PlayObject.IsEnoughBag())
                            {
                                UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                {
                                    PlayObject.m_ItemList.Add((IntPtr)UserItem);
                                    PlayObject.SendAddItem(UserItem);
                                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                    if (StdItem->NeedIdentify == 1)
                                    {
                                        M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString() + "\09"
                                            + PlayObject.m_sCharName + "\09" + sItemName + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() + "/"
                                            + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")" + "("
                                            + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() + "/"
                                            + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")"
                                            + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString()
                                            + "/" + (UserItem->btValue[3]).ToString() + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString()
                                            + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString() + "/" + (UserItem->btValue[8]).ToString()
                                            + "/" + (UserItem->btValue[14]).ToString() + "\09" + this.m_sCharName);
                                    }
                                }
                                else
                                {
                                    Marshal.FreeHGlobal((IntPtr)UserItem);
                                }
                            }
                            else
                            {
                                UserItem = (TUserItem*)Marshal.AllocHGlobal(sizeof(TUserItem));
                                if (UserEngine.CopyToUserItemFromName(sItemName, UserItem))
                                {
                                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                                    if (StdItem->NeedIdentify == 1)
                                    {
                                        M2Share.AddGameDataLog("9" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09"
                                            + (PlayObject.m_nCurrY).ToString() + "\09" + PlayObject.m_sCharName + "\09" + sItemName + "\09"
                                            + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() + "/" + (HUtil32.HiWord(StdItem->DC)).ToString()
                                            + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")"
                                            + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString()
                                            + "/" + (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString()
                                            + ")" + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/"
                                            + (UserItem->btValue[3]).ToString() + "/" + (UserItem->btValue[4]).ToString() + "/" + (UserItem->btValue[5]).ToString() + "/"
                                            + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString() + "/" + (UserItem->btValue[8]).ToString() + "/"
                                            + (UserItem->btValue[14]).ToString() + "\09" + this.m_sCharName);
                                    }
                                    PlayObject.DropItemDown(UserItem, 3, false, false, PlayObject, PlayObject);
                                }
                                else
                                {
                                    Marshal.FreeHGlobal((IntPtr)UserItem);
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGiveItem");
            }
        }

        private void ActionOfGmExecute(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sData;
            byte btOldPermission;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            string sParam3 = string.Empty;
            string sParam4;
            string sParam5;
            string sParam6;
            int nParam2 = 0;
            int nParam3 = 0;
            int nParam4 = 0;
            int nParam5 = 0;
            int nParam6 = 0;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sParam1 = QuestActionInfo.sParam1;
                sParam2 = QuestActionInfo.sParam2;
                sParam3 = QuestActionInfo.sParam3;
                sParam4 = QuestActionInfo.sParam4;
                sParam5 = QuestActionInfo.sParam5;
                sParam6 = QuestActionInfo.sParam6;
                if ((sParam2 != "") && (sParam2[0] == '<') && (sParam2[1] == '$'))
                {
                    sParam2 = GetLineVariableText(PlayObject, sParam2);
                }
                else
                {
                    GetValValue(PlayObject, sParam2, ref sParam2);
                }
                if ((sParam3 != "") && (sParam3[0] == '<') && (sParam3[1] == '$'))
                {
                    sParam3 = GetLineVariableText(PlayObject, sParam3);
                }
                else
                {
                    GetValValue(PlayObject, sParam3, ref sParam3);
                }
                if ((sParam4 != "") && (sParam4[0] == '<') && (sParam4[1] == '$'))
                {
                    sParam4 = GetLineVariableText(PlayObject, sParam4);
                }
                else
                {
                    GetValValue(PlayObject, sParam4, ref sParam4);
                }
                if ((sParam5 != "") && (sParam5[0] == '<') && (sParam5[1] == '$'))
                {
                    sParam5 = GetLineVariableText(PlayObject, sParam5);
                }
                else
                {
                    GetValValue(PlayObject, sParam5, ref sParam5);
                }
                if ((sParam6 != "") && (sParam6[0] == '<') && (sParam6[1] == '$'))
                {
                    sParam6 = GetLineVariableText(PlayObject, sParam6);
                }
                else
                {
                    GetValValue(PlayObject, sParam6, ref sParam6);
                }
                if (GetValValue(PlayObject, sParam2, ref nParam2))
                {
                    sParam2 = (nParam2).ToString();
                }
                if (GetValValue(PlayObject, sParam3, ref nParam3))
                {
                    sParam3 = (nParam3).ToString();
                }
                if (GetValValue(PlayObject, sParam4, ref nParam4))
                {
                    sParam4 = (nParam4).ToString();
                }
                if (GetValValue(PlayObject, sParam5, ref nParam5))
                {
                    sParam5 = (nParam5).ToString();
                }
                if (GetValValue(PlayObject, sParam6, ref nParam6))
                {
                    sParam6 = (nParam6).ToString();
                }
                if ((sParam2).ToLower().CompareTo(("Self").ToLower()) == 0)
                {
                    sParam2 = PlayObject.m_sCharName;
                }
                sData = string.Format("@{0} {1} {2} {3} {4} {5}", sParam1, sParam2, sParam3, sParam4, sParam5, sParam6);
                btOldPermission = PlayObject.m_btPermission;
                try
                {
                    PlayObject.m_btPermission = 10;
                    PlayObject.ProcessUserLineMsg(sData);
                }
                finally
                {
                    PlayObject.m_btPermission = btOldPermission;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGmExecute");
            }
        }

        private void ActionOfGuildAuraePoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nAuraePoint;
            char cMethod;
            TGUild Guild;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nAuraePoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nAuraePoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nAuraePoint))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_AURAEPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sScriptGuildAuraePointNoGuild, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        Guild.nAurae = nAuraePoint;
                        break;
                    case '-':
                        if (Guild.nAurae >= nAuraePoint)
                        {
                            Guild.nAurae = Guild.nAurae - nAuraePoint;
                        }
                        else
                        {
                            Guild.nAurae = 0;
                        }
                        break;
                    case '+':
                        if ((Int32.MaxValue - Guild.nAurae) >= nAuraePoint)
                        {
                            Guild.nAurae = Guild.nAurae + nAuraePoint;
                        }
                        else
                        {
                            Guild.nAurae = Int32.MaxValue;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptGuildAuraePointMsg, new int[] { Guild.nAurae }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGuildAuraePoint");
            }
        }

        private void ActionOfGuildBuildPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nBuildPoint;
            char cMethod;
            TGUild Guild;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nBuildPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nBuildPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nBuildPoint))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_BUILDPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sScriptGuildBuildPointNoGuild, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        Guild.nBuildPoint = nBuildPoint;
                        break;
                    case '-':
                        if (Guild.nBuildPoint >= nBuildPoint)
                        {
                            Guild.nBuildPoint = Guild.nBuildPoint - nBuildPoint;
                        }
                        else
                        {
                            Guild.nBuildPoint = 0;
                        }
                        break;
                    case '+':
                        if ((Int32.MaxValue - Guild.nBuildPoint) >= nBuildPoint)
                        {
                            Guild.nBuildPoint = Guild.nBuildPoint + nBuildPoint;
                        }
                        else
                        {
                            Guild.nBuildPoint = Int32.MaxValue;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptGuildBuildPointMsg, Guild.nBuildPoint), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGuildBuildPoint");
            }
        }

        private void ActionOfGuildChiefItemCount(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nItemCount;
            char cMethod;
            TGUild Guild;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nItemCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nItemCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nItemCount))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_GUILDCHIEFITEMCOUNT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sScriptGuildFlourishPointNoGuild, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        Guild.nChiefItemCount = nItemCount;
                        break;
                    case '-':
                        if (Guild.nChiefItemCount >= nItemCount)
                        {
                            Guild.nChiefItemCount = Guild.nChiefItemCount - nItemCount;
                        }
                        else
                        {
                            Guild.nChiefItemCount = 0;
                        }
                        break;
                    case '+':
                        if ((Int32.MaxValue - Guild.nChiefItemCount) >= nItemCount)
                        {
                            Guild.nChiefItemCount = Guild.nChiefItemCount + nItemCount;
                        }
                        else
                        {
                            Guild.nChiefItemCount = Int32.MaxValue;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {

                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptChiefItemCountMsg, new int[] { Guild.nChiefItemCount }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGuildChiefItemCount");
            }
        }

        private void ActionOfGuildFlourishPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nFlourishPoint;
            char cMethod;
            TGUild Guild;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nFlourishPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nFlourishPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nFlourishPoint))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_FLOURISHPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sScriptGuildFlourishPointNoGuild, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        Guild.nFlourishing = nFlourishPoint;
                        break;
                    case '-':
                        if (Guild.nFlourishing >= nFlourishPoint)
                        {
                            Guild.nFlourishing = Guild.nFlourishing - nFlourishPoint;
                        }
                        else
                        {
                            Guild.nFlourishing = 0;
                        }
                        break;
                    case '+':
                        if ((Int32.MaxValue - Guild.nFlourishing) >= nFlourishPoint)
                        {
                            Guild.nFlourishing = Guild.nFlourishing + nFlourishPoint;
                        }
                        else
                        {
                            Guild.nFlourishing = Int32.MaxValue;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {

                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptGuildFlourishPointMsg, new int[] { Guild.nFlourishing }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGuildFlourishPoint");
            }
        }

        private void ActionOfGuildstabilityPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nStabilityPoint;
            char cMethod;
            TGUild Guild;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nStabilityPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nStabilityPoint < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nStabilityPoint))
                    {
                        // 增加变量支持
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_STABILITYPOINT);
                        return;
                    }
                }
                if (PlayObject.m_MyGuild == null)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sScriptGuildStabilityPointNoGuild, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                Guild = PlayObject.m_MyGuild;
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        Guild.nStability = nStabilityPoint;
                        break;
                    case '-':
                        if (Guild.nStability >= nStabilityPoint)
                        {
                            Guild.nStability = Guild.nStability - nStabilityPoint;
                        }
                        else
                        {
                            Guild.nStability = 0;
                        }
                        break;
                    case '+':
                        if ((Int32.MaxValue - Guild.nStability) >= nStabilityPoint)
                        {
                            Guild.nStability = Guild.nStability + nStabilityPoint;
                        }
                        else
                        {
                            Guild.nStability = Int32.MaxValue;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {

                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptGuildStabilityPointMsg, new int[] { Guild.nStability }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfGuildstabilityPoint");
            }
        }

        private void ActionOfHumanHP(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nHP;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nHP = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nHP < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nHP))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_HUMANHP);
                        return;
                    }
                }
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        PlayObject.m_WAbil.HP = nHP;
                        break;
                    case '-':
                        if (PlayObject.m_WAbil.HP >= nHP)
                        {
                            PlayObject.m_WAbil.HP -= nHP;
                        }
                        else
                        {
                            PlayObject.m_WAbil.HP = 0;
                        }
                        break;
                    case '+':
                        PlayObject.m_WAbil.HP += nHP;
                        if (PlayObject.m_WAbil.HP > PlayObject.m_WAbil.MaxHP)
                        {
                            PlayObject.m_WAbil.HP = PlayObject.m_WAbil.MaxHP;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptChangeHumanHPMsg, new int[] { PlayObject.m_WAbil.MaxHP }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfHumanHP");
            }
        }

        private void ActionOfHumanMP(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMP;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMP = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nMP < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nMP))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_HUMANMP);
                        return;
                    }
                }
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        PlayObject.m_WAbil.MP = nMP;
                        break;
                    case '-':
                        if (PlayObject.m_WAbil.MP >= nMP)
                        {
                            PlayObject.m_WAbil.MP -= nMP;
                        }
                        else
                        {
                            PlayObject.m_WAbil.MP = 0;
                        }
                        break;
                    case '+':
                        PlayObject.m_WAbil.MP += nMP;
                        if (PlayObject.m_WAbil.MP > PlayObject.m_WAbil.MaxMP)
                        {
                            PlayObject.m_WAbil.MP = PlayObject.m_WAbil.MaxMP;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {
                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sScriptChangeHumanMPMsg, new int[] { PlayObject.m_WAbil.MaxMP }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfHumanMP");
            }
        }

        /// <summary>
        /// 功能:永久增加人物属性点。
        /// 格式:USEBONUSPOINT 属性位置（1-9） 控制符（+,-,=） 点数</summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfUseBonusPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nPosition = 0;
            int nCount = 0;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (!(QuestActionInfo.sParam1[0] >= '0' && QuestActionInfo.sParam1[1] <= '9'))
                {
                    if (QuestActionInfo.sParam1 == "DC")
                    {
                        nPosition = 1;
                    }
                    if (QuestActionInfo.sParam1 == "MC")
                    {
                        nPosition = 2;
                    }
                    if (QuestActionInfo.sParam1 == "SC")
                    {
                        nPosition = 3;
                    }
                    if (QuestActionInfo.sParam1 == "AC")
                    {
                        nPosition = 4;
                    }
                    if (QuestActionInfo.sParam1 == "MAC")
                    {
                        nPosition = 5;
                    }
                    if (QuestActionInfo.sParam1 == "HP")
                    {
                        nPosition = 6;
                    }
                    if (QuestActionInfo.sParam1 == "MP")
                    {
                        nPosition = 7;
                    }
                    if (QuestActionInfo.sParam1 == "Hit")
                    {
                        nPosition = 8;
                    }
                    if (QuestActionInfo.sParam1 == "SPD")
                    {
                        nPosition = 9;
                    }
                }
                else
                {
                    nPosition = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);
                }
                cMethod = QuestActionInfo.sParam2[1];
                nCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam3), -1);
                if ((nPosition < 0) || (nCount < 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_USEBONUSPOINT);
                    return;
                }
                if ((QuestActionInfo.sParam4).ToLower().CompareTo(("HERO").ToLower()) == 0)
                {
                    if (((!PlayObject.m_boHasHero) || (!PlayObject.m_boHasHeroTwo)) && (PlayObject.m_sHeroCharName == ""))
                    {
                        // ScriptActionError(PlayObject, '', QuestActionInfo, sSC_USEBONUSPOINT);
                        return;
                    }
                    if (PlayObject.m_MyHero != null)
                    {
                        switch (cMethod)
                        {
                            case '+':
                                switch (nPosition)
                                {
                                    case 1:
                                        PlayObject.m_MyHero.m_BonusAbil.DC += (ushort)nCount;
                                        break;
                                    case 2:
                                        PlayObject.m_MyHero.m_BonusAbil.MC += (ushort)nCount;
                                        break;
                                    case 3:
                                        PlayObject.m_MyHero.m_BonusAbil.SC += (ushort)nCount;
                                        break;
                                    case 4:
                                        PlayObject.m_MyHero.m_BonusAbil.AC += (ushort)nCount;
                                        break;
                                    case 5:
                                        PlayObject.m_MyHero.m_BonusAbil.MAC += (ushort)nCount;
                                        break;
                                    case 6:
                                        PlayObject.m_MyHero.m_BonusAbil.HP += (ushort)nCount;
                                        break;
                                    case 7:
                                        PlayObject.m_MyHero.m_BonusAbil.MP += (ushort)nCount;
                                        break;
                                    case 8:
                                        PlayObject.m_MyHero.m_BonusAbil.Hit += (ushort)nCount;
                                        break;
                                    case 9:
                                        PlayObject.m_MyHero.m_BonusAbil.Speed += (ushort)nCount;
                                        break;
                                }
                                break;
                            case '-':
                                switch (nPosition)
                                {
                                    case 1:
                                        PlayObject.m_MyHero.m_BonusAbil.DC -= (ushort)nCount;
                                        break;
                                    case 2:
                                        PlayObject.m_MyHero.m_BonusAbil.MC -= (ushort)nCount;
                                        break;
                                    case 3:
                                        PlayObject.m_MyHero.m_BonusAbil.SC -= (ushort)nCount;
                                        break;
                                    case 4:
                                        PlayObject.m_MyHero.m_BonusAbil.AC -= (ushort)nCount;
                                        break;
                                    case 5:
                                        PlayObject.m_MyHero.m_BonusAbil.MAC -= (ushort)nCount;
                                        break;
                                    case 6:
                                        PlayObject.m_MyHero.m_BonusAbil.HP -= (ushort)nCount;
                                        break;
                                    case 7:
                                        PlayObject.m_MyHero.m_BonusAbil.MP -= (ushort)nCount;
                                        break;
                                    case 8:
                                        PlayObject.m_MyHero.m_BonusAbil.Hit -= (ushort)nCount;
                                        break;
                                    case 9:
                                        PlayObject.m_MyHero.m_BonusAbil.Speed -= (ushort)nCount;
                                        break;
                                }
                                break;
                            case '=':
                                switch (nPosition)
                                {
                                    case 1:
                                        PlayObject.m_MyHero.m_BonusAbil.DC = (ushort)nCount;
                                        break;
                                    case 2:
                                        PlayObject.m_MyHero.m_BonusAbil.MC = (ushort)nCount;
                                        break;
                                    case 3:
                                        PlayObject.m_MyHero.m_BonusAbil.SC = (ushort)nCount;
                                        break;
                                    case 4:
                                        PlayObject.m_MyHero.m_BonusAbil.AC = (ushort)nCount;
                                        break;
                                    case 5:
                                        PlayObject.m_MyHero.m_BonusAbil.MAC = (ushort)nCount;
                                        break;
                                    case 6:
                                        PlayObject.m_MyHero.m_BonusAbil.HP = (ushort)nCount;
                                        break;
                                    case 7:
                                        PlayObject.m_MyHero.m_BonusAbil.MP = (ushort)nCount;
                                        break;
                                    case 8:
                                        PlayObject.m_MyHero.m_BonusAbil.Hit = (ushort)nCount;
                                        break;
                                    case 9:
                                        PlayObject.m_MyHero.m_BonusAbil.Speed = (ushort)nCount;
                                        break;
                                }
                                break;
                        }
                        ((THeroObject)(PlayObject.m_MyHero)).RecalcAbilitys();
                        PlayObject.m_MyHero.CompareSuitItem(false);// 套装
                        ((THeroObject)(PlayObject.m_MyHero)).SendMsg(PlayObject.m_MyHero, Grobal2.RM_HEROABILITY, 0, 0, 0, 0, "");// 发送英雄属性
                        ((THeroObject)(PlayObject.m_MyHero)).SendMsg(PlayObject.m_MyHero, Grobal2.RM_SUBABILITY, 0, 0, 0, 0, "");
                    }
                }
                else
                {
                    switch (cMethod)
                    {
                        case '+':
                            switch (nPosition)
                            {
                                case 1:
                                    PlayObject.m_BonusAbil.DC += (ushort)nCount;
                                    break;
                                case 2:
                                    PlayObject.m_BonusAbil.MC += (ushort)nCount;
                                    break;
                                case 3:
                                    PlayObject.m_BonusAbil.SC += (ushort)nCount;
                                    break;
                                case 4:
                                    PlayObject.m_BonusAbil.AC += (ushort)nCount;
                                    break;
                                case 5:
                                    PlayObject.m_BonusAbil.MAC += (ushort)nCount;
                                    break;
                                case 6:
                                    PlayObject.m_BonusAbil.HP += (ushort)nCount;
                                    break;
                                case 7:
                                    PlayObject.m_BonusAbil.MP += (ushort)nCount;
                                    break;
                                case 8:
                                    PlayObject.m_BonusAbil.Hit += (ushort)nCount;
                                    break;
                                case 9:
                                    PlayObject.m_BonusAbil.Speed += (ushort)nCount;
                                    break;
                            }
                            break;
                        case '-':
                            switch (nPosition)
                            {
                                case 1:
                                    PlayObject.m_BonusAbil.DC -= (ushort)nCount;
                                    break;
                                case 2:
                                    PlayObject.m_BonusAbil.MC -= (ushort)nCount;
                                    break;
                                case 3:
                                    PlayObject.m_BonusAbil.SC -= (ushort)nCount;
                                    break;
                                case 4:
                                    PlayObject.m_BonusAbil.AC -= (ushort)nCount;
                                    break;
                                case 5:
                                    PlayObject.m_BonusAbil.MAC -= (ushort)nCount;
                                    break;
                                case 6:
                                    PlayObject.m_BonusAbil.HP -= (ushort)nCount;
                                    break;
                                case 7:
                                    PlayObject.m_BonusAbil.MP -= (ushort)nCount;
                                    break;
                                case 8:
                                    PlayObject.m_BonusAbil.Hit -= (ushort)nCount;
                                    break;
                                case 9:
                                    PlayObject.m_BonusAbil.Speed -= (ushort)nCount;
                                    break;
                            }
                            break;
                        case '=':
                            switch (nPosition)
                            {
                                case 1:
                                    PlayObject.m_BonusAbil.DC = (ushort)nCount;
                                    break;
                                case 2:
                                    PlayObject.m_BonusAbil.MC = (ushort)nCount;
                                    break;
                                case 3:
                                    PlayObject.m_BonusAbil.SC = (ushort)nCount;
                                    break;
                                case 4:
                                    PlayObject.m_BonusAbil.AC = (ushort)nCount;
                                    break;
                                case 5:
                                    PlayObject.m_BonusAbil.MAC = (ushort)nCount;
                                    break;
                                case 6:
                                    PlayObject.m_BonusAbil.HP = (ushort)nCount;
                                    break;
                                case 7:
                                    PlayObject.m_BonusAbil.MP = (ushort)nCount;
                                    break;
                                case 8:
                                    PlayObject.m_BonusAbil.Hit = (ushort)nCount;
                                    break;
                                case 9:
                                    PlayObject.m_BonusAbil.Speed = (ushort)nCount;
                                    break;
                            }
                            break;
                    }
                    PlayObject.RecalcAbilitys();
                    PlayObject.CompareSuitItem(false);
                    PlayObject.SendMsg(PlayObject, Grobal2.RM_ABILITY, 0, 0, 0, 0, "");
                    PlayObject.SendMsg(PlayObject, Grobal2.RM_SUBABILITY, 0, 0, 0, 0, "");
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfUseBonusPoint");
            }
        }

        /// <summary>
        /// 功能：干掉所有在线玩家
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfKick(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_boKickFlag = true;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKick");
            }
        }

        /// <summary>
        /// 功能：干掉指定玩家
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfKill(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMode;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nMode = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                if (nMode >= 0 && nMode <= 3)
                {
                    switch (nMode)
                    {
                        case 1:
                            PlayObject.m_boNoItem = true;
                            PlayObject.Die();
                            break;
                        case 2:
                            PlayObject.SetLastHiter(this);
                            PlayObject.Die();
                            break;
                        case 3:
                            PlayObject.m_boNoItem = true;
                            PlayObject.SetLastHiter(this);
                            PlayObject.Die();
                            break;
                        default:
                            PlayObject.Die();
                            break;
                    }
                }
                else
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_KILL);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfKill");
            }
        }

        private void ActionOfBonusPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nBonusPoint;
            char cMethod;
            try
            {
                nBonusPoint = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nBonusPoint < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref nBonusPoint);// 增加变量支持
                }
                if ((nBonusPoint < 0) || (nBonusPoint > 10000))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_BONUSPOINT);
                    return;
                }
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        //FillChar(PlayObject.m_BonusAbil, sizeof(TNakedAbility), '\0');
                        PlayObject.HasLevelUp(0);
                        PlayObject.m_nBonusPoint = nBonusPoint;
                        PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                        break;
                    case '-':
                        if (PlayObject.m_nBonusPoint >= nBonusPoint)
                        {
                            PlayObject.m_nBonusPoint -= nBonusPoint;
                        }
                        else
                        {
                            PlayObject.m_nBonusPoint = 0;
                        }
                        PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                        break;
                    case '+':
                        PlayObject.m_nBonusPoint += nBonusPoint;
                        PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfBonusPoint");
            }
        }

        private void ActionOfDelMarry(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_sDearName = "";
                PlayObject.RefShowName();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDelMarry");
            }
        }

        private void ActionOfDelMaster(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_sMasterName = "";
                PlayObject.RefShowName();
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfDelMaster");
            }
        }

        private void ActionOfRestBonusPoint(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nTotleUsePoint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nTotleUsePoint = PlayObject.m_BonusAbil.DC + PlayObject.m_BonusAbil.MC + PlayObject.m_BonusAbil.SC + PlayObject.m_BonusAbil.AC + PlayObject.m_BonusAbil.MAC 
                    + PlayObject.m_BonusAbil.HP + PlayObject.m_BonusAbil.MP + PlayObject.m_BonusAbil.Hit + PlayObject.m_BonusAbil.Speed + PlayObject.m_BonusAbil.X2;
                //FillChar(PlayObject.m_BonusAbil, sizeof(TNakedAbility), '\0');
                PlayObject.m_nBonusPoint += nTotleUsePoint;
                PlayObject.SendMsg(PlayObject, Grobal2.RM_ADJUST_BONUS, 0, 0, 0, 0, "");
                PlayObject.HasLevelUp(0);
                PlayObject.SysMsg("分配点数已复位！！！", TMsgColor.c_Red, TMsgType.t_Hint);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRestBonusPoint");
            }
        }

        private void ActionOfRestReNewLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.m_btReLevel = 0;
                PlayObject.HasLevelUp(0);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfRestReNewLevel");
            }
        }

        private void ActionOfSetMapMode(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TEnvirnoment Envir;
            string sMapName;
            string sMapMode;
            string sParam1 = string.Empty;
            string sParam2 = string.Empty;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sMapName = QuestActionInfo.sParam1;
                sMapMode = QuestActionInfo.sParam2;
                sParam1 = QuestActionInfo.sParam3;
                sParam2 = QuestActionInfo.sParam4;
                Envir = M2Share.g_MapManager.FindMap(sMapName);
                if ((Envir == null) || (sMapMode == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETMAPMODE);
                    return;
                }
                if ((sMapMode).ToLower().CompareTo(("SAFE").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boSAFE = true;
                    }
                    else
                    {
                        Envir.m_boSAFE = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("DARK").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boDARK = true;
                    }
                    else
                    {
                        Envir.m_boDARK = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("DARK").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boDARK = true;
                    }
                    else
                    {
                        Envir.m_boDARK = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("FIGHT").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boFightZone = true;
                    }
                    else
                    {
                        Envir.m_boFightZone = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("FIGHT2").ToLower()) == 0)
                {
                    // PK掉装备地图
                    if ((sParam1 != ""))
                    {
                        Envir.m_boFight2Zone = true;
                    }
                    else
                    {
                        Envir.m_boFight2Zone = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("FIGHT3").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boFight3Zone = true;
                    }
                    else
                    {
                        Envir.m_boFight3Zone = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("FIGHT4").ToLower()) == 0)
                {
                    // 挑战地图 20080706
                    if ((sParam1 != ""))
                    {
                        Envir.m_boFight4Zone = true;
                    }
                    else
                    {
                        Envir.m_boFight4Zone = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("DAY").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boDAY = true;
                    }
                    else
                    {
                        Envir.m_boDAY = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("QUIZ").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boQUIZ = true;
                    }
                    else
                    {
                        Envir.m_boQUIZ = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NORECONNECT").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNORECONNECT = true;
                        Envir.sNoReconnectMap = sParam1;
                    }
                    else
                    {
                        Envir.m_boNORECONNECT = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("MUSIC").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boMUSIC = true;
                        Envir.m_nMUSICID = HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boMUSIC = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("EXPRATE").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boEXPRATE = true;
                        Envir.m_nEXPRATE = HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boEXPRATE = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("PKWINLEVEL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boPKWINLEVEL = true;
                        Envir.m_nPKWINLEVEL = HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boPKWINLEVEL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("PKWINEXP").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boPKWINEXP = true;
                        Envir.m_nPKWINEXP = (uint)HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boPKWINEXP = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("PKLOSTLEVEL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boPKLOSTLEVEL = true;
                        Envir.m_nPKLOSTLEVEL = HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boPKLOSTLEVEL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("PKLOSTEXP").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boPKLOSTEXP = true;
                        Envir.m_nPKLOSTEXP = (uint)HUtil32.Str_ToInt(sParam1, -1);
                    }
                    else
                    {
                        Envir.m_boPKLOSTEXP = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("DECHP").ToLower()) == 0)
                {
                    if ((sParam1 != "") && (sParam2 != ""))
                    {
                        Envir.m_boDECHP = true;
                        Envir.m_nDECHPTIME = HUtil32.Str_ToInt(sParam1, -1);
                        Envir.m_nDECHPPOINT = HUtil32.Str_ToInt(sParam2, -1);
                    }
                    else
                    {
                        Envir.m_boDECHP = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("DECGAMEGOLD").ToLower()) == 0)
                {
                    if ((sParam1 != "") && (sParam2 != ""))
                    {
                        Envir.m_boDecGameGold = true;
                        Envir.m_nDECGAMEGOLDTIME = HUtil32.Str_ToInt(sParam1, -1);
                        Envir.m_nDecGameGold = HUtil32.Str_ToInt(sParam2, -1);
                    }
                    else
                    {
                        Envir.m_boDecGameGold = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("RUNHUMAN").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boRUNHUMAN = true;
                    }
                    else
                    {
                        Envir.m_boRUNHUMAN = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("RUNMON").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boRUNMON = true;
                    }
                    else
                    {
                        Envir.m_boRUNMON = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NEEDHOLE").ToLower()) == 0)// 进入需要洞
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNEEDHOLE = true;
                    }
                    else
                    {
                        Envir.m_boNEEDHOLE = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NORECALL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNORECALL = true;
                    }
                    else
                    {
                        Envir.m_boNORECALL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NOGUILDRECALL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNOGUILDRECALL = true;
                    }
                    else
                    {
                        Envir.m_boNOGUILDRECALL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NODEARRECALL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNODEARRECALL = true;
                    }
                    else
                    {
                        Envir.m_boNODEARRECALL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NOMASTERRECALL").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNOMASTERRECALL = true;
                    }
                    else
                    {
                        Envir.m_boNOMASTERRECALL = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NORANDOMMOVE").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNORANDOMMOVE = true;
                    }
                    else
                    {
                        Envir.m_boNORANDOMMOVE = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NODRUG").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNODRUG = true;
                    }
                    else
                    {
                        Envir.m_boNODRUG = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("MINE").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boMINE = true;
                    }
                    else
                    {
                        Envir.m_boMINE = false;
                    }
                }
                else if ((sMapMode).ToLower().CompareTo(("NOPOSITIONMOVE").ToLower()) == 0)
                {
                    if ((sParam1 != ""))
                    {
                        Envir.m_boNOPOSITIONMOVE = true;
                    }
                    else
                    {
                        Envir.m_boNOPOSITIONMOVE = false;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetMapMode");
            }
        }

        private void ActionOfSetMemberLevel(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nLevel;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nLevel = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nLevel < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nLevel))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETMEMBERLEVEL);
                        return;
                    }
                }
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        PlayObject.m_nMemberLevel = nLevel;
                        break;
                    case '-':
                        PlayObject.m_nMemberLevel -= nLevel;
                        if (PlayObject.m_nMemberLevel < 0)
                        {
                            PlayObject.m_nMemberLevel = 0;
                        }
                        break;
                    case '+':
                        PlayObject.m_nMemberLevel += nLevel;
                        if (PlayObject.m_nMemberLevel > 65535)
                        {
                            PlayObject.m_nMemberLevel = 65535;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {

                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sChangeMemberLevelMsg, new int[] { PlayObject.m_nMemberLevel }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetMemberLevel");
            }
        }

        private void ActionOfSetMemberType(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nType;
            char cMethod;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nType = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam2), -1);
                if (nType < 0)
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam2, ref nType))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SETMEMBERTYPE);
                        return;
                    }
                }
                cMethod = QuestActionInfo.sParam1[1];
                switch (cMethod)
                {
                    case '=':
                        PlayObject.m_nMemberType = nType;
                        break;
                    case '-':
                        PlayObject.m_nMemberType -= nType;
                        if (PlayObject.m_nMemberType < 0)
                        {
                            PlayObject.m_nMemberType = 0;
                        }
                        break;
                    case '+':
                        PlayObject.m_nMemberType += nType;
                        if (PlayObject.m_nMemberType > 65535)
                        {
                            PlayObject.m_nMemberType = 65535;
                        }
                        break;
                }
                if (M2Share.g_Config.boShowScriptActionMsg)
                {

                    PlayObject.SysMsg(string.Format(GameMsgDef.g_sChangeMemberTypeMsg, new int[] { PlayObject.m_nMemberType }), TMsgColor.c_Green, TMsgType.t_Hint);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSetMemberType");
            }
        }
        
        /// <summary>
        /// 检测地图命令
        /// 格式:ISONMAP 地图
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestConditionInfo"></param>
        /// <returns></returns>
        private bool ConditionOfISONMAP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            string sMapName;
            TEnvirnoment Envir;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                sMapName = GetLineVariableText(PlayObject, QuestConditionInfo.sParam1);// 地图支持变量
                Envir = M2Share.g_MapManager.FindMap(sMapName);
                if (Envir == null)
                {
                    ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_ISONMAP);
                    return result;
                }
                if (PlayObject.m_PEnvir == Envir)
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfISONMAP");
            }
            return result;
        }

        private void ActionOfUnMaster(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            TPlayObject PoseHuman;
            string sMsg;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                if (PlayObject.m_sMasterName == "")
                {
                    GotoLable(PlayObject, "@ExeMasterFail", false);
                    return;
                }
                PoseHuman = ((TPlayObject)(PlayObject.GetPoseCreate()));
                if (PoseHuman == null)
                {
                    GotoLable(PlayObject, "@UnMasterCheckDir", false);
                }
                if (PoseHuman != null)
                {
                    if (QuestActionInfo.sParam1 == "")
                    {
                        if (PoseHuman.m_btRaceServer != Grobal2.RC_PLAYOBJECT)
                        {
                            GotoLable(PlayObject, "@UnMasterTypeErr", false);
                            return;
                        }
                        if (PoseHuman.GetPoseCreate() == PlayObject)
                        {
                            if ((PlayObject.m_sMasterName == PoseHuman.m_sCharName))
                            {
                                if (PlayObject.m_boMaster)
                                {
                                    GotoLable(PlayObject, "@UnIsMaster", false);
                                    return;
                                }
                                if (PlayObject.m_sMasterName != PoseHuman.m_sCharName)
                                {
                                    GotoLable(PlayObject, "@UnMasterError", false);
                                    return;
                                }
                                GotoLable(PlayObject, "@StartUnMaster", false);
                                GotoLable(PoseHuman, "@WateUnMaster", false);
                                return;
                            }
                        }
                    }
                }
                if (((QuestActionInfo.sParam1).ToLower().CompareTo(("REQUESTUNMASTER").ToLower()) == 0))// 正常出师
                {
                    if ((QuestActionInfo.sParam2 == ""))  // PoseHuman-师傅 PlayObject-徒弟
                    {
                        if (PoseHuman != null)
                        {
                            PlayObject.m_boStartUnMaster = true;
                            if (PlayObject.m_boStartUnMaster && PoseHuman.m_boStartUnMaster)
                            {
                                sMsg = GameMsgDef.g_sNPCSayUnMasterOKMsg.Replace("%n", this.m_sCharName);
                                sMsg = sMsg.Replace("%s", PlayObject.m_sCharName);
                                sMsg = sMsg.Replace("%d", PoseHuman.m_sCharName);
                                UserEngine.SendBroadCastMsg(sMsg, TMsgType.t_Say);
                                PlayObject.m_sMasterName = "";
                                PoseHuman.m_sMasterName = "";
                                PlayObject.m_boStartUnMaster = false;
                                PoseHuman.m_boStartUnMaster = false;
                                PoseHuman.DelMaster(PlayObject.m_sCharName);// 出师
                                if (M2Share.g_FunctionNPC != null)
                                {
                                    M2Share.g_FunctionNPC.GotoLable(PoseHuman, "@UnMasterEnd", false);// 师傅触发
                                    M2Share.g_FunctionNPC.GotoLable(PlayObject, "@UnMasterEnd1", false);// 徒弟触发
                                }
                                PlayObject.RefShowName();
                                PoseHuman.RefShowName();
                                GotoLable(PlayObject, "@UnMasterEnd", false);
                                GotoLable(PoseHuman, "@UnMasterEnd", false);
                            }
                            else
                            {
                                GotoLable(PlayObject, "@WateUnMaster", false);
                                GotoLable(PoseHuman, "@RevUnMaster", false);
                            }
                        }
                        return;
                    }
                    else
                    {
                        if (((QuestActionInfo.sParam2).ToLower().CompareTo(("FORCE").ToLower()) == 0))// 强行出师
                        {
                            sMsg = GameMsgDef.g_sNPCSayForceUnMasterMsg.Replace("%n", this.m_sCharName);
                            sMsg = sMsg.Replace("%s", PlayObject.m_sCharName);
                            sMsg = sMsg.Replace("%d", PlayObject.m_sMasterName);
                            UserEngine.SendBroadCastMsg(sMsg, TMsgType.t_Say);
                            if (M2Share.g_FunctionNPC != null)
                            {
                                M2Share.g_FunctionNPC.GotoLable(PlayObject, "@UnMasterEnd1", false);  // 徒弟触发
                            }
                            PoseHuman = UserEngine.GetPlayObject(PlayObject.m_sMasterName);
                            if (PoseHuman != null)
                            {
                                PoseHuman.m_sMasterName = "";
                                PoseHuman.DelMaster(PlayObject.m_sCharName);// 出师
                                if (M2Share.g_FunctionNPC != null)
                                {
                                    M2Share.g_FunctionNPC.GotoLable(PoseHuman, "@UnMasterEnd", false);// 师傅触发
                                }
                                PoseHuman.RefShowName();
                            }
                            else
                            {
                                //M2Share.g_UnForceMasterList.__Lock();
                                try
                                {
                                    //M2Share.g_UnForceMasterList.Add(PlayObject.m_sMasterName + " " + PlayObject.m_sCharName);
                                    M2Share.SaveUnForceMasterList();
                                }
                                finally
                                {
                                    //  M2Share.g_UnForceMasterList.UnLock();
                                }
                            }
                            PlayObject.m_sMasterName = "";
                            GotoLable(PlayObject, "@UnMasterEnd", false);
                            PlayObject.RefShowName();
                        }
                        return;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfUnMaster");
            }
        }

        private unsafe void ActionOfClearNeedItems(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nNeed;
            TUserItem* UserItem;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nNeed = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestActionInfo.sParam1), -1);
                if ((nNeed < 0))
                {
                    if (!GetValValue(PlayObject, QuestActionInfo.sParam1, ref nNeed))
                    {
                        ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CLEARNEEDITEMS);
                        return;
                    }
                }
                for (int I = PlayObject.m_ItemList.Count - 1; I >= 0; I--)
                {
                    if (PlayObject.m_ItemList.Count <= 0)
                    {
                        break;
                    }
                    UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                    if (UserItem == null)
                    {
                        continue;
                    }
                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                    if ((StdItem != null) && (StdItem->Need == nNeed))
                    {
                        PlayObject.SendDelItems(UserItem);
                        Marshal.FreeHGlobal((IntPtr)UserItem);//By Dr.Kevin修正此处内存泄漏
                        PlayObject.m_ItemList.RemoveAt(I);
                    }
                }
                for (int I = PlayObject.m_StorageItemList.Count - 1; I >= 0; I--)
                {
                    if (PlayObject.m_StorageItemList.Count <= 0)
                    {
                        break;
                    }
                    UserItem = (TUserItem*)PlayObject.m_StorageItemList[I];
                    if (UserItem == null)
                    {
                        continue;
                    }
                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                    if ((StdItem != null) && (StdItem->Need == nNeed))
                    {
                        Marshal.FreeHGlobal((IntPtr)UserItem);//By Dr.Kevin修正此处内存泄漏
                        PlayObject.m_StorageItemList.RemoveAt(I);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearNeedItems");
            }
        }

        private unsafe void ActionOfClearMakeItems(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nMakeIndex;
            string sItemName;
            TUserItem* UserItem;
            TStdItem* StdItem;
            bool boMatchName;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sItemName = QuestActionInfo.sParam1;
                nMakeIndex = QuestActionInfo.nParam2;
                boMatchName = QuestActionInfo.sParam3 == "1";
                if ((sItemName == "") || (nMakeIndex <= 0))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CLEARMAKEITEMS);
                    return;
                }
                for (int I = PlayObject.m_ItemList.Count - 1; I >= 0; I--)
                {
                    if (PlayObject.m_ItemList.Count <= 0)
                    {
                        break;
                    }
                    UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                    if (UserItem == null)
                    {
                        continue;
                    }
                    if (UserItem->MakeIndex != nMakeIndex)
                    {
                        continue;
                    }
                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                    if (!boMatchName || ((StdItem != null) && (HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen).ToLower().CompareTo((sItemName).ToLower()) == 0)))
                    {
                        PlayObject.SendDelItems(UserItem);
                        Marshal.FreeHGlobal((IntPtr)UserItem);//By Dr.Kevin修正此处内存泄漏
                        PlayObject.m_ItemList.RemoveAt(I);
                    }
                }
                for (int I = PlayObject.m_StorageItemList.Count - 1; I >= 0; I--)
                {
                    if (PlayObject.m_StorageItemList.Count <= 0)
                    {
                        break;
                    }
                    UserItem = (TUserItem*)PlayObject.m_ItemList[I];
                    if (UserItem == null)
                    {
                        continue;
                    }
                    if (UserItem->MakeIndex != nMakeIndex)
                    {
                        continue;
                    }
                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                    if (!boMatchName || ((StdItem != null) && (HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen).ToLower().CompareTo((sItemName).ToLower()) == 0)))
                    {
                        Marshal.FreeHGlobal((IntPtr)UserItem);
                        PlayObject.m_StorageItemList.RemoveAt(I);
                    }
                }
                for (int I = PlayObject.m_UseItems.GetLowerBound(0); I <= PlayObject.m_UseItems.GetUpperBound(0); I++)
                {
                    UserItem = PlayObject.m_UseItems[I];
                    if (UserItem->MakeIndex != nMakeIndex)
                    {
                        continue;
                    }
                    StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                    if (!boMatchName || ((StdItem != null) && (HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen).ToLower().CompareTo((sItemName).ToLower()) == 0)))
                    {
                        UserItem->wIndex = 0;
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfClearMakeItems");
            }
        }

        /// <summary>
        /// 功能：发送祝福语
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="sMsg">文字</param>
        public virtual void SendCustemMsg(TPlayObject PlayObject, string sMsg)
        {
            try
            {
                if (!M2Share.g_Config.boSendCustemMsg)
                {
                    PlayObject.SysMsg(GameMsgDef.g_sSendCustMsgCanNotUseNowMsg, TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                if (PlayObject.m_boSendMsgFlag)
                {
                    PlayObject.m_boSendMsgFlag = false;
                    UserEngine.SendBroadCastMsg(PlayObject.m_sCharName + ": " + sMsg, TMsgType.t_Cust);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.SendCustemMsg");
            }
        }

        private bool ConditionOfCheckPasswordErrorCount(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nErrorCount;
            char cMethod;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nErrorCount = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, QuestConditionInfo.sParam2), -1);
                if (nErrorCount < 0)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam2, ref nErrorCount))
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_PASSWORDERRORCOUNT);
                        return result;
                    }
                }
                cMethod = QuestConditionInfo.sParam1[0];
                switch (cMethod)
                {
                    case '=':
                        if (PlayObject.m_btPwdFailCount == nErrorCount)
                        {
                            result = true;
                        }
                        break;
                    case '>':
                        if (PlayObject.m_btPwdFailCount > nErrorCount)
                        {
                            result = true;
                        }
                        break;
                    case '<':
                        if (PlayObject.m_btPwdFailCount < nErrorCount)
                        {
                            result = true;
                        }
                        break;
                    default:
                        if (PlayObject.m_btPwdFailCount >= nErrorCount)
                        {
                            result = true;
                        }
                        break;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPasswordErrorCount");
            }
            return result;
        }

        private bool ConditionOfIsLockPassword(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = PlayObject.m_boPasswordLocked;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfIsLockPassword");
            }
            return result;
        }

        private bool ConditionOfIsLockStorage(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = !PlayObject.m_boCanGetBackItem;
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfIsLockStorage");
            }
            return result;
        }

        private bool ConditionOfCheckPayMent(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            int nPayMent;
            try
            {
                if (QuestConditionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return result;
                    }
                }
                result = false;
                nPayMent = HUtil32.Str_ToInt(QuestConditionInfo.sParam1, -1);
                if (nPayMent < 1)
                {
                    if (!GetValValue(PlayObject, QuestConditionInfo.sParam1, ref nPayMent)) // 增加变量支持
                    {
                        ScriptConditionError(PlayObject, QuestConditionInfo, M2Share.sSC_CHECKPAYMENT);
                        return result;
                    }
                }
                if (PlayObject.m_nPayMent == nPayMent)
                {
                    result = true;
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ConditionOfCheckPayMent");
            }
            return result;
        }

        /// <summary>
        /// 升级物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfUpgradeItems(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nRate;
            int nWhere;
            int nValType;
            int nPoint;
            int nAddPoint;
            TUserItem* UserItem = null;
            TStdItem* StdItem;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                nRate = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                nPoint = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);
                if (nWhere < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nWhere); // 增加变量支持
                }
                if (nRate < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref nRate);// 增加变量支持
                }
                if (nPoint < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam3, ref nPoint);// 增加变量支持
                }
                if ((nWhere < 0) || (nWhere > m_UseItems.GetUpperBound(0)) || (nRate < 0) || (nPoint < 0) || (nPoint > 255))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_UPGRADEITEMS);
                    return;
                }
                UserItem = PlayObject.m_UseItems[nWhere];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    PlayObject.SysMsg("您身上没有戴指定物品！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                nRate = HUtil32.Random(nRate);
                nPoint = HUtil32.Random(nPoint);
                nValType = HUtil32.Random(16);
                if (nRate != 0)
                {
                    PlayObject.SysMsg("装备升级失败！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                UserItem->btValue[9] = (byte)HUtil32._MIN(255, UserItem->btValue[9] + 1);// 累积升级次数
                if ((nValType == 15) && (StdItem->Shape == 188)) // 吸伤属性
                {
                    UserItem->btValue[20] = Convert.ToByte(UserItem->btValue[20] + nPoint);
                    if (UserItem->btValue[20] > 100)
                    {
                        UserItem->btValue[20] = 100;
                    }
                }
                else if (nValType == 14)
                {
                    nAddPoint = (nPoint * 1000);
                    if (UserItem->DuraMax + nAddPoint > ushort.MaxValue)
                    {
                        nAddPoint = ushort.MaxValue - UserItem->DuraMax;
                    }
                    UserItem->DuraMax = Convert.ToUInt16(UserItem->DuraMax + nAddPoint);
                }
                else
                {
                    nAddPoint = nPoint;
                    if (UserItem->btValue[nValType] + nAddPoint > Byte.MaxValue)
                    {
                        nAddPoint = Byte.MaxValue - UserItem->btValue[nValType];
                    }
                    UserItem->btValue[nValType] = Convert.ToByte(UserItem->btValue[nValType] + nAddPoint);
                    if (StdItem->NeedIdentify == 1)
                    {
                        M2Share.AddGameDataLog("31" + "\09" + PlayObject.m_sMapName + "\09" + (PlayObject.m_nCurrX).ToString() + "\09" + (PlayObject.m_nCurrY).ToString()
                            + "\09" + PlayObject.m_sCharName + "\09" + HUtil32.SBytePtrToString(StdItem->Name, StdItem->NameLen) + "\09" + (UserItem->MakeIndex).ToString() + "\09" + "(" + (HUtil32.LoWord(StdItem->DC)).ToString() 
                            + "/" + (HUtil32.HiWord(StdItem->DC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MC)).ToString() + ")" 
                            + "(" + (HUtil32.LoWord(StdItem->SC)).ToString() + "/" + (HUtil32.HiWord(StdItem->SC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->AC)).ToString() + "/" +
                            (HUtil32.HiWord(StdItem->AC)).ToString() + ")" + "(" + (HUtil32.LoWord(StdItem->MAC)).ToString() + "/" + (HUtil32.HiWord(StdItem->MAC)).ToString() + ")" 
                            + (UserItem->btValue[0]).ToString() + "/" + (UserItem->btValue[1]).ToString() + "/" + (UserItem->btValue[2]).ToString() + "/" + (UserItem->btValue[3]).ToString() 
                            + "/" + UserItem->btValue[4] + "/" + (UserItem->btValue[5]).ToString() + "/" + (UserItem->btValue[6]).ToString() + "/" + (UserItem->btValue[7]).ToString() 
                            + "/" + UserItem->btValue[8] + "/" + (UserItem->btValue[14]).ToString() + "\09" + (UserItem->Dura).ToString() + "/" + (UserItem->DuraMax).ToString());
                    }
                }
                PlayObject.SendUpdateItem(UserItem);
                PlayObject.SysMsg("装备升级成功", TMsgColor.c_Green, TMsgType.t_Hint);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfUpgradeItems");
            }
        }

        /// <summary>
        /// 升级物品
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private unsafe void ActionOfUpgradeItemsEx(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            int nRate;
            int nWhere;
            int nValType;
            int nPoint;
            int nAddPoint;
            TUserItem* UserItem;
            TStdItem* StdItem;
            int nUpgradeItemStatus;
            int nRatePoint;
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                nWhere = HUtil32.Str_ToInt(QuestActionInfo.sParam1, -1);
                nValType = HUtil32.Str_ToInt(QuestActionInfo.sParam2, -1);
                nRate = HUtil32.Str_ToInt(QuestActionInfo.sParam3, -1);
                nPoint = HUtil32.Str_ToInt(QuestActionInfo.sParam4, -1);
                if (nWhere < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam1, ref nWhere);
                }
                if (nValType < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam2, ref nValType);
                }
                if (nRate < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam3, ref nRate);
                }
                if (nPoint < 0)
                {
                    GetValValue(PlayObject, QuestActionInfo.sParam4, ref nPoint);
                }
                nUpgradeItemStatus = HUtil32.Str_ToInt(QuestActionInfo.sParam5, -1);
                if ((nValType < 0) || (nValType > 15) || (nWhere < 0) || (nWhere > m_UseItems.GetUpperBound(0)) || (nRate < 0) || (nPoint < 0) || (nPoint > 255))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_UPGRADEITEMSEX);
                    return;
                }
                UserItem = PlayObject.m_UseItems[nWhere];
                StdItem = UserEngine.GetStdItem(UserItem->wIndex);
                if ((UserItem->wIndex <= 0) || (StdItem == null))
                {
                    PlayObject.SysMsg("您身上没有戴指定物品！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                    return;
                }
                nRatePoint = HUtil32.Random(nRate * 10);
                nPoint = HUtil32._MAX(1, HUtil32.Random(nPoint));
                if (!(nRatePoint >= 0 && nRatePoint <= 10))
                {
                    switch (nUpgradeItemStatus)
                    {
                        case 0:
                            PlayObject.SysMsg("装备升级未成功！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                            break;
                        case 1:
                            PlayObject.SendDelItems(UserItem);
                            UserItem->wIndex = 0;
                            PlayObject.SysMsg("装备破碎！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                            break;
                        case 2:
                            PlayObject.SysMsg("装备升级失败，装备属性恢复默认！！！", TMsgColor.c_Red, TMsgType.t_Hint);
                            if (nValType != 14)
                            {
                                UserItem->btValue[nValType] = 0;
                            }
                            if ((nValType == 15) && (StdItem->Shape == 188))
                            {
                                UserItem->btValue[20] = 0;
                            }
                            break;
                    }
                    return;
                }
                UserItem->btValue[9] = (byte)HUtil32._MIN(255, UserItem->btValue[9] + 1);// 累积升级次数
                if ((nValType == 15) && (StdItem->Shape == 188))// 吸收伤害属性
                {
                    UserItem->btValue[20] = Convert.ToByte(UserItem->btValue[20] + nPoint);
                    if (UserItem->btValue[20] > 100)
                    {
                        UserItem->btValue[20] = 100;
                    }
                }
                else if (nValType == 14)
                {
                    nAddPoint = (nPoint * 1000);
                    if (UserItem->DuraMax + nAddPoint > ushort.MaxValue)
                    {
                        nAddPoint = ushort.MaxValue - UserItem->DuraMax;
                    }
                    UserItem->DuraMax =Convert.ToUInt16(UserItem->DuraMax + nAddPoint);
                }
                else
                {
                    nAddPoint = nPoint;
                    if (UserItem->btValue[nValType] + nAddPoint > Byte.MaxValue)
                    {
                        nAddPoint = Byte.MaxValue - UserItem->btValue[nValType];
                    }
                    UserItem->btValue[nValType] = Convert.ToByte(UserItem->btValue[nValType] + nAddPoint);
                }
                PlayObject.SendUpdateItem(UserItem);
                PlayObject.SysMsg("装备升级成功", TMsgColor.c_Green, TMsgType.t_Hint);
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfUpgradeItemsEx");
            }
        }

        // 声明变量
        // VAR 数据类型(Integer String) 类型(HUMAN GUILD GLOBAL) 变量值
        private void ActionOfVar(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sType;
            TVarType VarType;
            string sVarName;
            string sVarValue;
            int nVarValue;
            string sName = string.Empty;
            TDynamicVar DynamicVar;
            bool boFoundVar;
            IList<TDynamicVar> DynamicVarList;
            const string sVarFound = "变量%s已存在，变量类型:{0}";
            const string sVarTypeError = "变量类型错误，错误类型:%s 当前支持类型(HUMAN、GUILD、GLOBAL)";
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sType = QuestActionInfo.sParam2;
                sVarName = QuestActionInfo.sParam3;
                sVarValue = QuestActionInfo.sParam4;
                nVarValue = HUtil32.Str_ToInt(QuestActionInfo.sParam4, 0);
                VarType = TVarType.vNone;
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("Integer").ToLower()) == 0)
                {
                    VarType = TVarType.vInteger;
                }
                if ((QuestActionInfo.sParam1).ToLower().CompareTo(("String").ToLower()) == 0)
                {
                    VarType = TVarType.vString;
                }
                if ((sType == "") || (sVarName == "") || (VarType == TVarType.vNone))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_VAR);
                    return;
                }
                DynamicVar = new TDynamicVar();
                DynamicVar.sName = sVarName;
                DynamicVar.VarType = VarType;
                DynamicVar.nInternet = nVarValue;
                DynamicVar.sString = sVarValue;
                boFoundVar = false;
                DynamicVarList = GetDynamicVarList(PlayObject, sType, ref sName);
                if (DynamicVarList == null)
                {
                    Dispose(DynamicVar);
                    ScriptActionError(PlayObject, string.Format(sVarTypeError, sType), QuestActionInfo, M2Share.sSC_VAR);
                    return;
                }
                if (DynamicVarList.Count > 0)
                {
                    for (int I = 0; I < DynamicVarList.Count; I++)
                    {
                        if (DynamicVarList[I].sName.ToLower().CompareTo((sVarName).ToLower()) == 0)
                        {
                            boFoundVar = true;
                            break;
                        }
                    }
                }
                if (!boFoundVar)
                {
                    DynamicVarList.Add(DynamicVar);
                }
                else
                {
                    Dispose(DynamicVar);
                    ScriptActionError(PlayObject, string.Format(sVarFound, sVarName, sType), QuestActionInfo, M2Share.sSC_VAR);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfVar");
            }
        }

        /// <summary>
        /// 读取变量值
        /// LOADVAR 变量类型 变量名 文件名
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfLoadVar(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sType;
            string sVarName = string.Empty;
            string sFileName = string.Empty;
            string sName = string.Empty;
            TDynamicVar DynamicVar;
            bool boFoundVar;
            IList<TDynamicVar> DynamicVarList;
            IniFile IniFile;
            const string sVarFound = "变量%s不存在，变量类型:%s";
            const string sVarTypeError = "变量类型错误，错误类型:%s 当前支持类型(HUMAN、GUILD、GLOBAL)";
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sType = QuestActionInfo.sParam1;
                sVarName = QuestActionInfo.sParam2;
                sFileName = QuestActionInfo.sParam3;
                if (sFileName[0] == '\\')
                {
                    sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
                }
                if (sFileName[1] == '\\')
                {
                    sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
                }
                if (sFileName[2] == '\\')
                {
                    sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
                }
                sFileName = M2Share.g_Config.sEnvirDir + sFileName;
                if ((sType == "") || (sVarName == "") || !File.Exists(sFileName))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_LOADVAR);
                    return;
                }
                boFoundVar = false;
                DynamicVarList = GetDynamicVarList(PlayObject, sType, ref sName);
                if (DynamicVarList == null)
                {

                    ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sType }), QuestActionInfo, M2Share.sSC_VAR);
                    return;
                }
                else
                {
                    IniFile = new IniFile(sFileName);
                    try
                    {
                        if (DynamicVarList.Count > 0)
                        {
                            for (int I = 0; I < DynamicVarList.Count; I++)
                            {
                                DynamicVar = DynamicVarList[I];
                                if (DynamicVar != null)
                                {
                                    if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                                    {
                                        switch (DynamicVar.VarType)
                                        {
                                            case TVarType.vInteger:
                                                DynamicVar.nInternet = IniFile.ReadInteger(sName, DynamicVar.sName, 0);
                                                break;
                                            case TVarType.vString:
                                                DynamicVar.sString = IniFile.ReadString(sName, DynamicVar.sName, "");
                                                break;
                                        }
                                        boFoundVar = true;
                                        break;
                                    }
                                }
                            }
                        }
                        if (!boFoundVar)
                        {
                            ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sVarName, sType }), QuestActionInfo, M2Share.sSC_LOADVAR);
                        }
                    }
                    finally
                    {
                        Dispose(IniFile);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfLoadVar");
            }
        }

        // 保存变量值
        // SAVEVAR 变量类型 变量名 文件名
        private void ActionOfSaveVar(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sType;
            string sVarName;
            string sFileName;
            string sName = string.Empty;
            TDynamicVar DynamicVar;
            bool boFoundVar;
            IList<TDynamicVar> DynamicVarList;
            IniFile IniFile;
            const string sVarFound = "变量{0}不存在，变量类型:{1}";
            const string sVarTypeError = "变量类型错误，错误类型:{0} 当前支持类型(HUMAN、GUILD、GLOBAL)";
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                sType = QuestActionInfo.sParam1;
                sVarName = QuestActionInfo.sParam2;
                sFileName = QuestActionInfo.sParam3;
                if (sFileName[0] == '\\')
                {
                    sFileName = sFileName.Substring(2 - 1, sFileName.Length - 1);
                }
                // 增加,处理文件路径
                if (sFileName[1] == '\\')
                {
                    sFileName = sFileName.Substring(3 - 1, sFileName.Length - 2);
                }
                if (sFileName[2] == '\\')
                {
                    sFileName = sFileName.Substring(4 - 1, sFileName.Length - 3);
                }
                sFileName = M2Share.g_Config.sEnvirDir + sFileName;
                if ((sType == "") || (sVarName == "") || !File.Exists(sFileName))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_SAVEVAR);
                    return;
                }
                boFoundVar = false;
                DynamicVarList = GetDynamicVarList(PlayObject, sType, ref sName);
                if (DynamicVarList == null)
                {
                    ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sType }), QuestActionInfo, M2Share.sSC_VAR);
                    return;
                }
                else
                {
                    IniFile = new IniFile(sFileName);
                    if (DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if (DynamicVar != null)
                            {
                                if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                                {
                                    switch (DynamicVar.VarType)
                                    {
                                        case TVarType.vInteger:
                                            IniFile.WriteInteger(sName, DynamicVar.sName, DynamicVar.nInternet);
                                            break;
                                        case TVarType.vString:
                                            IniFile.WriteString(sName, DynamicVar.sName, DynamicVar.sString);
                                            break;
                                    }
                                    boFoundVar = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sVarName, sType }), QuestActionInfo, M2Share.sSC_SAVEVAR);
                    }
                    Dispose(IniFile);
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfSaveVar");
            }
        }

        // 对变量进行运算(+、-、*、/、=)
        private void ActionOfCalcVar(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            string sType;
            string sVarName;
            string sName = string.Empty;
            string sVarValue = string.Empty;
            string sVarValue2 = string.Empty;
            int nVarValue = 0;
            string sMethod = string.Empty;
            char cMethod;
            TDynamicVar DynamicVar;
            bool boFoundVar;
            IList<TDynamicVar> DynamicVarList;
            const string sVarFound = "变量%s不存在，变量类型:%s";
            const string sVarTypeError = "变量类型错误，错误类型:%s 当前支持类型(HUMAN、GUILD、GLOBAL)";
            try
            {
                sType = QuestActionInfo.sParam1;// 类型
                sVarName = QuestActionInfo.sParam2;// 自定义变量
                sMethod = QuestActionInfo.sParam3;// 操作符 +-*/=
                sVarValue = QuestActionInfo.sParam4;// 变量
                if ((sType == "") || (sVarName == "") || (sMethod == ""))
                {
                    ScriptActionError(PlayObject, "", QuestActionInfo, M2Share.sSC_CALCVAR);
                    return;
                }
                boFoundVar = false;
                if ((sVarValue != "") && (!HUtil32.IsStringNumber(sVarValue)))
                {
                    if (HUtil32.CompareLStr(sVarValue, "<$HUMAN(", 8))
                    {
                        HUtil32.ArrestStringEx(sVarValue, "(", ")", ref sVarValue2);
                        sVarValue = sVarValue2;
                        if (PlayObject.m_DynamicVarList.Count > 0)
                        {
                            for (int I = 0; I < PlayObject.m_DynamicVarList.Count; I++)
                            {
                                DynamicVar = PlayObject.m_DynamicVarList[I];
                                if ((DynamicVar.sName).ToLower().CompareTo((sVarValue).ToLower()) == 0)
                                {
                                    switch (DynamicVar.VarType)
                                    {
                                        case TVarType.vInteger:
                                            nVarValue = DynamicVar.nInternet;
                                            break;
                                        case TVarType.vString:
                                            sVarValue = DynamicVar.sString;
                                            break;
                                    }
                                    boFoundVar = true;
                                    break;
                                }
                            }
                        }
                        if (!boFoundVar)
                        {
                            ScriptActionError(PlayObject, string.Format(sVarFound, new string[] { sVarValue, sType }), QuestActionInfo, M2Share.sSC_CALCVAR);
                            return;
                        }
                    }
                    else
                    {
                        nVarValue = HUtil32.Str_ToInt(GetLineVariableText(PlayObject, sVarValue), 0);
                        sVarValue = GetLineVariableText(PlayObject, sVarValue);
                    }
                }
                else
                {
                    nVarValue = HUtil32.Str_ToInt(QuestActionInfo.sParam4, 0);
                }
                boFoundVar = false;
                cMethod = sMethod[1];
                DynamicVarList = GetDynamicVarList(PlayObject, sType, ref sName);
                if (DynamicVarList == null)
                {
                    ScriptActionError(PlayObject, string.Format(sVarTypeError, new string[] { sType }), QuestActionInfo, M2Share.sSC_CALCVAR);
                    return;
                }
                else
                {
                    if (DynamicVarList.Count > 0)
                    {
                        for (int I = 0; I < DynamicVarList.Count; I++)
                        {
                            DynamicVar = DynamicVarList[I];
                            if (DynamicVar != null)
                            {
                                if ((DynamicVar.sName).ToLower().CompareTo((sVarName).ToLower()) == 0)
                                {
                                    switch (DynamicVar.VarType)
                                    {
                                        case TVarType.vInteger:
                                            switch (cMethod)
                                            {
                                                case '=':
                                                    DynamicVar.nInternet = nVarValue;
                                                    break;
                                                case '+':
                                                    DynamicVar.nInternet = DynamicVar.nInternet + nVarValue;
                                                    break;
                                                case '-':
                                                    DynamicVar.nInternet = DynamicVar.nInternet - nVarValue;
                                                    break;
                                                case '*':
                                                    DynamicVar.nInternet = DynamicVar.nInternet * nVarValue;
                                                    break;
                                                case '/':
                                                    DynamicVar.nInternet = DynamicVar.nInternet / nVarValue;
                                                    break;
                                            }
                                            break;
                                        case TVarType.vString:
                                            switch (cMethod)
                                            {
                                                case '=':
                                                    DynamicVar.sString = sVarValue;
                                                    break;
                                                case '+':
                                                    DynamicVar.sString = DynamicVar.sString + sVarValue;
                                                    break;
                                                case '-':
                                                    break;
                                            }
                                            break;
                                    }
                                    boFoundVar = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (!boFoundVar)
                    {
                        ScriptActionError(PlayObject, string.Format(sVarFound, sVarName, sType), QuestActionInfo, M2Share.sSC_CALCVAR);
                    }
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfCalcVar");
            }
        }

        private IList<TDynamicVar> GetDynamicVarList(TPlayObject PlayObject, string sType, ref string sName)
        {
            IList<TDynamicVar> result = null;
            try
            {
                result = null;
                if (HUtil32.CompareLStr(sType, "HUMAN", 5))
                {
                    result = PlayObject.m_DynamicVarList;
                    sName = PlayObject.m_sCharName;
                }
                else if (HUtil32.CompareLStr(sType, "GUILD", 5))
                {
                    if (PlayObject.m_MyGuild == null)
                    {
                        return result;
                    }
                    result = PlayObject.m_MyGuild.m_DynamicVarList;
                    sName = PlayObject.m_MyGuild.sGuildName;
                }
                else if (HUtil32.CompareLStr(sType, "GLOBAL", 6))
                {
                    result = M2Share.g_DynamicVarList;
                    sName = "GLOBAL";
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.GetDynamicVarList");
            }
            return result;
        }

        private bool ConditionOfCHECKHEROOPENOPULS(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            if (QuestConditionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            result = false;
            if (PlayObject.m_MyHero != null)
            {
                if (((THeroObject)(PlayObject.m_MyHero)).m_boTrainingNG)
                {
                    result = ((THeroObject)(PlayObject.m_MyHero)).m_boisOpenPuls;
                }
            }
            return result;
        }

        private bool ConditionOfCHECKITMECOUNTDURA(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            return false;
        }

        /// <summary>
        /// 功能：改变英雄经络修炼点(打通一条经络后才有效)
        /// 格式：CHANGEHEROPULSEXP 控制符(+,-,=) 经验值
        /// </summary>
        /// <param name="PlayObject"></param>
        /// <param name="QuestActionInfo"></param>
        private void ActionOfCHANGEHEROPULSEXP(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            char c1;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            c1 = QuestActionInfo.sParam1[1];
            if (PlayObject.m_MyHero != null)
            {
                switch (c1)
                {
                    case '+':
                        ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp + QuestActionInfo.nParam2;
                        break;
                    case '-':
                        ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp - QuestActionInfo.nParam2;
                        break;
                    case '=':
                        ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp;
                        break;
                }
            }
        }

        private void ActionOfOPENHEROPULS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            if (PlayObject.m_MyHero != null)
            {
                ((THeroObject)(PlayObject.m_MyHero)).m_boisOpenPuls = true;
            }
        }

        private bool ConditionOfCHECKHEROPULSEXP(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            char c1;
            if (QuestConditionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            result = false;
            c1 = QuestConditionInfo.sParam1[0];
            if (PlayObject.m_MyHero != null)
            {
                switch (c1)
                {
                    case '>':
                        result = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp > QuestConditionInfo.nParam2;
                        break;
                    case '<':
                        result = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp < QuestConditionInfo.nParam2;
                        break;
                    case '=':
                        result = ((THeroObject)(PlayObject.m_MyHero)).m_nPulseExp == QuestConditionInfo.nParam2;
                        break;
                }
            }
            return result;
        }

        private void ActionOfCHANGECATTLEGASEXP(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            // 富贵兽 
        }

        private void ActionOfCLOSECATTLEGAS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            // 富贵兽 
        }

        private void ActionOfOPENCATTLEGAS(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            // 富贵兽 
        }

        private void ActionOfTAKEITMECOUNTDURA(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            // 给定物品持久命令 
        }

        // 查询双英雄数据
        private void ActionOfASSESSMENTHERO(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            try
            {
                if (QuestActionInfo.sParam6 == "88")
                {
                    PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                    if (PlayObject == null)
                    {
                        return;
                    }
                }
                PlayObject.SendMsg(PlayObject, Grobal2.RM_SHOWASSESSDLG, 0, 0, 0, 0, "");
                if ((PlayObject.m_sHeroCharName == "") && (PlayObject.m_boHasHero || PlayObject.m_boHasHeroTwo)) // 身上没有英雄才能取回
                {
                    M2Share.FrontEngine.AddToLoadHeroRcdList(PlayObject.m_sCharName, "", PlayObject, 7);
                }
                else
                {
                }
            }
            catch
            {
                M2Share.MainOutMessage("{异常} TNormNpc.ActionOfASSESSMENTHERO");
            }
        }

        private void ActionOfOpenHeroAutoPractice(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            THeroDataInfo HeroData = null;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            if (!PlayObject.m_boHeroAutoTraining)
            {
                if (PlayObject.m_MyHero != null)
                {
                    if (((THeroObject)(PlayObject.m_MyHero)).m_btMentHero == 2)
                    {
                        HeroData.sChrName = ((THeroObject)(PlayObject.m_MyHero)).m_sCharName;
                        HeroData.Level = ((THeroObject)(PlayObject.m_MyHero)).m_Abil.Level;
                        HeroData.btSex = ((THeroObject)(PlayObject.m_MyHero)).m_btGender;
                        HeroData.btJob = ((THeroObject)(PlayObject.m_MyHero)).m_btJob;
                        HeroData.btType = ((THeroObject)(PlayObject.m_MyHero)).n_HeroTpye;
                        //PlayObject.SendMsg(PlayObject, Grobal2.RM_OPENTRAININGDLG, 0, 0, 0, 0, EDcode.Units.EDcode.EncodeBuffer(HeroData, sizeof(THeroDataInfo)));
                    }
                }
            }
        }

        private void ActionOfStopHeroAutoPractice(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            PlayObject.m_boHeroAutoTraining = false;
            PlayObject.SysMsg("副将英雄已停止修炼，召唤副将英雄后可以获得修炼过程中得到的经验和内功经验", TMsgColor.c_Blue, TMsgType.t_Hint);
        }

        // 检查是否评定过副将英雄
        private bool ConditionOfCheckAssessMentHero(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            if (QuestConditionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            result = false;
            if (PlayObject.m_sDeputyHeroCharName != "")
            {
                result = true;
            }
            return result;
        }

        // 评定当前在线英雄是否是副将英雄
        private bool ConditionOfCheckDeputyHero(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            result = false;
            if (PlayObject.m_MyHero != null)
            {
                if (((THeroObject)(PlayObject.m_MyHero)).m_btMentHero == 2)
                {
                    result = true;
                }
            }
            return result;
        }

        private bool ConditionOfCheckHeroAutoPractice(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            if (QuestConditionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            if (PlayObject.m_boHeroAutoTraining)
            {
                result = true;
            }
            else
            {
                result = false;
            }
            return result;
        }

        private unsafe void ActionOfCHANGETRANPOINT(TPlayObject PlayObject, TQuestActionInfo QuestActionInfo)
        {
            char cMethod;
            TUserMagic* UserMagic;
            if (QuestActionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestActionInfo.sParam7));
                if (PlayObject == null)
                {
                    return;
                }
            }
            cMethod = QuestActionInfo.sParam2[0];
            for (int I = 0; I < PlayObject.m_MagicList.Count; I++)
            {
                UserMagic = (TUserMagic*)PlayObject.m_MagicList[I];
                if ((UserMagic != null) && ((HUtil32.SBytePtrToString(UserMagic->MagicInfo.sDescr, 0, UserMagic->MagicInfo.DescrLen)).ToLower().CompareTo((QuestActionInfo.sParam1).ToLower()) == 0))
                {
                    switch (cMethod)
                    {
                        case '=':
                            UserMagic->nTranPoint = QuestActionInfo.nParam3;
                            break;
                        case '-':
                            if (UserMagic->nTranPoint > QuestActionInfo.nParam3)
                            {
                                UserMagic->nTranPoint = UserMagic->nTranPoint - QuestActionInfo.nParam3;
                            }
                            else
                            {
                                UserMagic->nTranPoint = 0;
                            }
                            break;
                        case '+':
                            UserMagic->nTranPoint = UserMagic->nTranPoint + QuestActionInfo.nParam3;
                            break;
                    }
                }
            }
        }

        // 检查护体神盾是否训练过
        private unsafe bool ConditionOfCHECKSKILL75(TPlayObject PlayObject, TQuestConditionInfo QuestConditionInfo)
        {
            bool result = false;
            if (QuestConditionInfo.sParam6 == "88")
            {
                PlayObject = UserEngine.GetPlayObject(GetLineVariableText(PlayObject, QuestConditionInfo.sParam7));
                if (PlayObject == null)
                {
                    return result;
                }
            }
            result = false;
            if ((QuestConditionInfo.sParam1).ToLower().CompareTo(("hero").ToLower()) == 0)
            {
                if (((THeroObject)(PlayObject.m_MyHero)) != null)
                {
                    if (((THeroObject)(PlayObject.m_MyHero)).m_Magic75Skill != null)
                    {
                        result = true;
                    }
                }
            }
            else
            {
                if (PlayObject.m_Magic75Skill != null)
                {
                    result = true;
                }
            }
            return result;
        }
    }
}
